diff --git a/shortcuts/bot/handler_test.go b/shortcuts/bot/handler_test.go index ada4791ba..3e48abaac 100644 --- a/shortcuts/bot/handler_test.go +++ b/shortcuts/bot/handler_test.go @@ -70,11 +70,9 @@ func TestNewBotHandler_MissingSessionManager(t *testing.T) { // TestBotHandler_extractTextContent tests text content extraction func TestBotHandler_extractTextContent(t *testing.T) { - handler, _ := NewBotHandler(BotHandlerConfig{ - ClaudeClient: NewClaudeClient(ClaudeClientConfig{}), - SessionManager: nil, // OK for this test - WorkDir: "/tmp", - }) + // Use &BotHandler{} directly for helper-level tests that only exercise + // extractTextContent (doesn't touch receiver state) + handler := &BotHandler{} tests := []struct { name string @@ -185,11 +183,9 @@ func TestBotHandler_parseMessageEvent(t *testing.T) { // TestBotHandler_parseMessageEvent_MissingFields tests error handling for incomplete events func TestBotHandler_parseMessageEvent_MissingFields(t *testing.T) { - handler, _ := NewBotHandler(BotHandlerConfig{ - ClaudeClient: NewClaudeClient(ClaudeClientConfig{}), - SessionManager: nil, - WorkDir: "/tmp", - }) + // Use &BotHandler{} directly since parseMessageEvent only parses event data + // and doesn't require SessionManager or ClaudeClient + handler := &BotHandler{} tests := []struct { name string diff --git a/shortcuts/bot/session_test.go b/shortcuts/bot/session_test.go index 7c726d751..b873b6d2f 100644 --- a/shortcuts/bot/session_test.go +++ b/shortcuts/bot/session_test.go @@ -217,7 +217,8 @@ func TestSessionManager_CleanupExpired(t *testing.T) { // Wait for expiration time.Sleep(60 * time.Millisecond) - // Refresh the active session to keep it alive + // Refresh the active session AFTER the sleep to keep it alive. + // This updates its mtime so it won't be expired when CleanupExpired runs. sm.Set("chat_active", "session_active_refreshed") // Cleanup expired