test: remove redundant cases and strengthen state-transition assertions (#33309)

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-10-24 17:05:58 -07:00
committed by GitHub
co-authored by OrcaWin
parent 44f97fa958
commit ca3b0fdb02
18 changed files with 41 additions and 128 deletions
@@ -71,6 +71,8 @@ describe('installMouseHideWhileTyping', () => {
const disposable = installMouseHideWhileTyping(terminal, container as unknown as HTMLElement)
disposable.dispose()
expect(terminal.onData.mock.results[0]?.value.dispose).toHaveBeenCalledTimes(1)
expect(container.style.cursor).toBe('')
// After dispose, mousemove should not crash and cursor stays restored.
container.dispatchEvent(new Event('mousemove'))
@@ -111,7 +111,7 @@ describe('useOsc52ClipboardDefaultOnNotice', () => {
expect(storeState.clearOsc52ClipboardDefaultOnNotice).toHaveBeenCalledTimes(1)
})
it('dedupes the StrictMode double-invoke with a stable toast id', async () => {
it('assigns a stable toast id for notice deduplication', async () => {
// Why pin the id: the effect re-runs against the same closure, so the early return
// cannot catch the second pass — sonner collapses it only because the id matches.
await mountProbe(true)
@@ -760,9 +760,12 @@ describe('createPaneForegroundAgentTracker', () => {
onCommandFinished: () => tracker.onCommandFinished()
})
lifecycle.handlePtyData("printf '\\033]133;A\\007\\033]777;agent=codex\\007\\033]133;D;0\\007'")
lifecycle.handlePtyData('\x1b]133;C\x07\x1b]777;agent=codex\x07')
await flushSettleRead(COMMAND_SETTLE_MS)
expect(remoteRead).toHaveBeenCalledExactlyOnceWith('ssh:conn-1@@pty-9', {
expectedIncarnationId: 'inc-remote'
})
expect(publish).not.toHaveBeenCalledWith(
expect.objectContaining({ agent: 'codex', shellForeground: false })
)
@@ -268,7 +268,7 @@ describe('startParkedTerminalByteWatcher', () => {
dispose()
})
it('suppresses the completion OS notification when only terminal attention is on', async () => {
it('forwards completion to notification policy when only terminal attention is on', async () => {
mockStoreState.settings = {
...mockStoreState.settings,
experimentalTerminalAttention: true,
@@ -10,7 +10,7 @@ describe('parseOsc7', () => {
expect(parseOsc7('file:///home/jin')).toBe('/home/jin')
})
it('percent-decodes spaces and unicode', () => {
it('percent-decodes spaces', () => {
expect(parseOsc7('file:///home/jin/my%20code')).toBe('/home/jin/my code')
})