Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

test(background-mode): follow the updater hooks object and the tray restart-update action

reviewbe8639f02456
diff --git a/src/main/background-mode.test.ts b/src/main/background-mode.test.ts
index e49ed17c8..5d84acc3c 100644
--- a/src/main/background-mode.test.ts
+++ b/src/main/background-mode.test.ts
@@ -42,9 +42,12 @@ describe('main/index.ts background-mode wiring (source guard)', () => {
expect(src).toMatch(/quitting = true \/\/ from here on[^\n]*\n\s*destroyNotchHud\(\)\n\s*backgroundTray\?\.destroy\(\)/)
})
it('keeps the updater restart flipping `quitting` so a hidden window really closes', () => {
- expect(src).toMatch(/initUpdater\(\(\) => \{\s*quitting = true/)
+ expect(src).toMatch(/initUpdater\(\{\s*onBeforeRestart: \(\) => \{\s*quitting = true/)
})
it('tray Quit goes through app.quit() (before-quit + confirm), not app.exit()', () => {
- expect(src).toMatch(/onAction: \(action\) => \(action === 'open' \? showMainWindowFromBackground\(\) : app\.quit\(\)\)/)
+ // ('restart-update' is the updater's own guarded restart; every other action is Quit.)
+ expect(src).toMatch(
+ /onAction: \(action\) =>\s*action === 'open'\s*\? showMainWindowFromBackground\(\)\s*: action === 'restart-update'\s*\? updater\?\.restartToUpdate\(\)\s*: app\.quit\(\)/
+ )
})
})