test: fix pre-existing failures — localStorage polyfill + prefs shape drift
- jsdom 29's localStorage methods are undefined under this vitest config, so every frontend test calling localStorage.clear()/setItem() threw. Add a shared in-memory Web Storage polyfill via setupFiles (no-op when a working Storage exists / in node env). Fixes quick-reply, push, projects-panel (135 tests). - Update desktop prefs test: defaultPrefs gained remoteHosts/selectedHostId (remote-host mTLS work); sync EXPECTED_DEFAULTS and the round-trip fixture. Full suite now green: 1473 passed (was 142 failing).
This commit is contained in:
@@ -18,6 +18,8 @@ const EXPECTED_DEFAULTS: DesktopPrefs = {
|
||||
openAtLogin: false,
|
||||
notifyOnApproval: true,
|
||||
notifyOnStatusChange: true,
|
||||
remoteHosts: [],
|
||||
selectedHostId: null,
|
||||
}
|
||||
|
||||
describe('defaultPrefs', () => {
|
||||
@@ -60,6 +62,8 @@ describe('validatePrefs', () => {
|
||||
openAtLogin: true,
|
||||
notifyOnApproval: false,
|
||||
notifyOnStatusChange: false,
|
||||
remoteHosts: [],
|
||||
selectedHostId: null,
|
||||
}
|
||||
|
||||
// Act
|
||||
|
||||
Reference in New Issue
Block a user