feat(setttings): support auto launch config (#415)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Haze <hazeone@users.noreply.github.com>
This commit is contained in:
@@ -47,6 +47,30 @@ describe('Settings Store', () => {
|
||||
setDevModeUnlocked(true);
|
||||
expect(useSettingsStore.getState().devModeUnlocked).toBe(true);
|
||||
});
|
||||
|
||||
it('should persist launch-at-startup setting through host api', () => {
|
||||
const invoke = vi.mocked(window.electron.ipcRenderer.invoke);
|
||||
invoke.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
data: {
|
||||
status: 200,
|
||||
ok: true,
|
||||
json: { success: true },
|
||||
},
|
||||
});
|
||||
|
||||
const { setLaunchAtStartup } = useSettingsStore.getState();
|
||||
setLaunchAtStartup(true);
|
||||
|
||||
expect(useSettingsStore.getState().launchAtStartup).toBe(true);
|
||||
expect(invoke).toHaveBeenCalledWith(
|
||||
'hostapi:fetch',
|
||||
expect.objectContaining({
|
||||
path: '/api/settings/launchAtStartup',
|
||||
method: 'PUT',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Gateway Store', () => {
|
||||
|
||||
Reference in New Issue
Block a user