Optimize gateway comms reload behavior and strengthen regression coverage (#496)

This commit is contained in:
Lingxuan Zuo
2026-03-15 20:36:48 +08:00
committed by GitHub
Unverified
parent 08960d700f
commit 1dbe4a8466
36 changed files with 1511 additions and 197 deletions

View File

@@ -43,9 +43,27 @@ describe('Settings Store', () => {
});
it('should unlock dev mode', () => {
const invoke = vi.mocked(window.electron.ipcRenderer.invoke);
invoke.mockResolvedValueOnce({
ok: true,
data: {
status: 200,
ok: true,
json: { success: true },
},
});
const { setDevModeUnlocked } = useSettingsStore.getState();
setDevModeUnlocked(true);
expect(useSettingsStore.getState().devModeUnlocked).toBe(true);
expect(invoke).toHaveBeenCalledWith(
'hostapi:fetch',
expect.objectContaining({
path: '/api/settings/devModeUnlocked',
method: 'PUT',
}),
);
});
it('should persist launch-at-startup setting through host api', () => {