test(tui): give the mounted switcher-close tests a budget that covers their waits (TUI-25)

The two mounted-switcher tests chain three `vi.waitFor` frame waits, each
allowed 10 s, but the test itself kept vitest's 5 s default. On the loaded
CI runner the first Ink frame took long enough that the test timed out at
5 s while its waits still had budget ("Test timed out in 5000ms" on #140183's
JS & TS checks). Each mounted test now declares 3 x WAIT; the assertions are
unchanged.

Refs #134889 (TUI-25)
Refs #140138
This commit is contained in:
Teknium
2026-10-16 21:02:03 -07:00
parent 580e79d7c2
commit 433cd1bc60

View File

@@ -19,6 +19,9 @@ import { DEFAULT_THEME } from '../theme.js'
// vi.waitFor's 1 s default is shorter than a first Ink frame on a loaded CI host.
const WAIT = { timeout: 10_000 }
// A mounted switcher chains three WAIT-bounded frame waits; the test's own budget must cover them,
// or vitest's 5 s default fires first on a loaded runner (the waits never get their 10 s).
const MOUNTED_TEST_TIMEOUT = 3 * WAIT.timeout
const liveRow = { id: 'live', session_id: 'live', title: 'Current conversation', started_at: 2, message_count: 1, running: false }
@@ -185,7 +188,7 @@ it('reports no close instead of blaming main when the canonical row is not held'
} finally {
m.instance.unmount()
}
})
}, MOUNTED_TEST_TIMEOUT)
it('keeps main\'s "already closed" for a receipt that refuses the close', async () => {
const onClose = vi.fn(async () => ({ closed: false }))
@@ -197,4 +200,4 @@ it('keeps main\'s "already closed" for a receipt that refuses the close', async
} finally {
m.instance.unmount()
}
})
}, MOUNTED_TEST_TIMEOUT)