fix(settings): harden audited state synchronization

This commit is contained in:
NimBold
2026-07-21 05:05:34 +03:30
parent 621652ae13
commit 69ce2b15ba
9 changed files with 304 additions and 37 deletions
+13
View File
@@ -37,6 +37,19 @@ describe('useSettingsStore global speed limit persistence', () => {
});
});
describe('useSettingsStore dock badge synchronization', () => {
it('increments the badge sync version for every toggle without issuing out-of-band clears', () => {
vi.clearAllMocks();
const initialVersion = useSettingsStore.getState().dockBadgeSyncVersion;
useSettingsStore.getState().setShowDockBadge(false);
useSettingsStore.getState().setShowDockBadge(true);
expect(useSettingsStore.getState().dockBadgeSyncVersion).toBe(initialVersion + 2);
expect(ipc.invokeCommand).not.toHaveBeenCalledWith('update_dock_badge', { count: 0 });
});
});
describe('useSettingsStore credential-store startup flow', () => {
beforeEach(() => {
vi.clearAllMocks();