test(terminal): repoint the STA-5505 window-close scope pin at its new file

The confirmNativeWindowClose block moved out of Terminal.tsx with the rest of
the prompt; the source-text pin followed it, with an indent anchor so a nested
copy cannot satisfy it.
This commit is contained in:
Brennan Benson
2026-08-28 11:16:48 -07:00
parent 0a4b2be8fd
commit 4946978057
@@ -190,10 +190,13 @@ describe('createShutdownCheckpointGuard', () => {
it('runs the quit checkpoint inside the window-close scope and surfaces a vetoed quit (STA-5505/#15352)', () => {
const source = readFileSync(
join(process.cwd(), 'src/renderer/src/components/Terminal.tsx'),
join(
process.cwd(),
'src/renderer/src/components/terminal/window-close-running-process-prompt.tsx'
),
'utf8'
)
const closeStart = source.indexOf('const confirmNativeWindowClose = useCallback(() => {')
const closeStart = source.indexOf(' const confirmNativeWindowClose = useCallback(() => {')
const closeEnd = source.indexOf('window.api.ui.confirmWindowClose()', closeStart)
expect(closeStart).toBeGreaterThanOrEqual(0)
expect(closeEnd).toBeGreaterThan(closeStart)