mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 16:02:03 +00:00
test: align hook notification fixtures with mobile delivery
This commit is contained in:
@@ -12,7 +12,7 @@ type MockStoreState = {
|
||||
settings: {
|
||||
experimentalTerminalAttention: boolean
|
||||
notifications: { enabled: boolean; agentTaskComplete: boolean }
|
||||
}
|
||||
} | null
|
||||
ptyIdsByTabId: Record<string, string[]>
|
||||
suppressedPtyExitIds: Record<string, boolean>
|
||||
tabsByWorktree: Record<string, { id: string; ptyId: string }[]>
|
||||
@@ -71,12 +71,14 @@ describe('agent hook completion fresh-working gate', () => {
|
||||
|
||||
afterEach(() => vi.useRealTimers())
|
||||
|
||||
it('stays gated through a stamped working completion after re-enable', async () => {
|
||||
it('waits for fresh working after settings hydration before dispatching completion', async () => {
|
||||
const {
|
||||
observeAgentHookCompletionForNotification,
|
||||
syncAgentHookCompletionNotificationSettings
|
||||
} = await import('./agent-hook-completion-notifications')
|
||||
|
||||
const hydratedSettings = mockStoreState.settings
|
||||
mockStoreState.settings = null
|
||||
syncAgentHookCompletionNotificationSettings()
|
||||
observeAgentHookCompletionForNotification({
|
||||
paneKey: PANE_KEY,
|
||||
@@ -84,7 +86,7 @@ describe('agent hook completion fresh-working gate', () => {
|
||||
payload: { ...working(), stateStartedAt: 1_000 }
|
||||
})
|
||||
|
||||
mockStoreState.settings.notifications.agentTaskComplete = true
|
||||
mockStoreState.settings = hydratedSettings
|
||||
syncAgentHookCompletionNotificationSettings()
|
||||
observeAgentHookCompletionForNotification({
|
||||
paneKey: PANE_KEY,
|
||||
|
||||
@@ -167,6 +167,10 @@ export function buildStoreState(overrides: StoreLike): StoreLike {
|
||||
updateTabTitles: vi.fn(),
|
||||
runtimePaneTitlesByTabId: {},
|
||||
terminalLayoutsByTabId: {},
|
||||
ptyIdsByTabId: {},
|
||||
suppressedPtyExitIds: {},
|
||||
markWorktreeUnread: vi.fn(),
|
||||
markAgentCompletionPaneUnread: vi.fn(),
|
||||
agentStatusByPaneKey: {},
|
||||
setAgentStatuses: vi.fn(() => []),
|
||||
recordAgentProviderSession: vi.fn(),
|
||||
|
||||
@@ -127,6 +127,7 @@ export function buildWindowApi(args: {
|
||||
onDetectedPortsChanged: () => () => {},
|
||||
...args.ssh
|
||||
},
|
||||
notifications: { dispatch: vi.fn(async () => ({ delivered: false })) },
|
||||
agentStatus: {
|
||||
onSet: args.onSet,
|
||||
onClear: args.onClear ?? vi.fn(() => () => {}),
|
||||
|
||||
Reference in New Issue
Block a user