Skip to content

The agent that grows with you

test(desktop): setup-card composer tests run with the onboarding phase shown

alt-glitch104eda93c66a
diff --git a/apps/desktop/src/app/chat/composer/hooks/use-composer-submit.test.tsx b/apps/desktop/src/app/chat/composer/hooks/use-composer-submit.test.tsx
index 832c7df5204..3e1b9a50747 100644
--- a/apps/desktop/src/app/chat/composer/hooks/use-composer-submit.test.tsx
+++ b/apps/desktop/src/app/chat/composer/hooks/use-composer-submit.test.tsx
@@ -13,6 +13,7 @@ import {
import { clearQueuedPrompts, getQueuedPrompts } from '@/store/composer-queue'
import { $connectionRequests, type ConnectionRequest } from '@/store/connection-request'
import { $gateway } from '@/store/gateway'
+import { $onboardingPhase } from '@/store/onboarding-phase'
import { $onboardingSession } from '@/store/onboarding-session'
import {
clearAllPrompts,
@@ -907,9 +908,11 @@ describe('useComposerSubmit with a setup card waiting in the onboarding chat', (
resetServerRequestsForTests()
$setupBeatRequests.set({})
$onboardingSession.set(null)
+ $onboardingPhase.set('idle')
})
it('closes the card unanswered and sends the words as the next turn, never into the card turn', () => {
+ $onboardingPhase.set('shown')
$onboardingSession.set({ runId: 'run-1', runtimeId: 'runtime-session', storedId: 'stored-session' })
const respond = parkCard('layout')
@@ -931,6 +934,7 @@ describe('useComposerSubmit with a setup card waiting in the onboarding chat', (
})
it('takes words typed on the name card as the name, and sends no message', () => {
+ $onboardingPhase.set('shown')
$onboardingSession.set({ runId: 'run-1', runtimeId: 'runtime-session', storedId: 'stored-session' })
const respond = parkCard('name')
diff --git a/apps/desktop/src/store/setup-beat.test.ts b/apps/desktop/src/store/setup-beat.test.ts
index e692cccd416..3c51c414f17 100644
--- a/apps/desktop/src/store/setup-beat.test.ts
+++ b/apps/desktop/src/store/setup-beat.test.ts
@@ -3,6 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { setupBeatOutcome } from '@/components/assistant-ui/setup-beat/receipt'
+import { $onboardingPhase } from './onboarding-phase'
import { $onboardingSession } from './onboarding-session'
import {
answerParkedCard,
@@ -41,6 +42,8 @@ function parkCard(requestId: string, open = true, beat: 'layout' | 'name' = 'nam
}
beforeEach(() => {
+ // A run is shown whenever its chat is named (startOnboarding).
+ $onboardingPhase.set('shown')
$onboardingSession.set({ runId: 'run-1', runtimeId: 'rt-1', storedId: 'stored-1' })
})
@@ -48,6 +51,7 @@ afterEach(() => {
resetServerRequestsForTests()
$setupBeatRequests.set({})
$onboardingSession.set(null)
+ $onboardingPhase.set('idle')
})
describe('setup_beat card', () => {