The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { describe, expect, it, vi } from "vite-plus/test"; |
| 2 | import { DEFAULT_BROWSER_PROFILE_ID, INCOGNITO_BROWSER_PROFILE_ID } from "@t3tools/contracts"; |
| 3 | |
| 4 | const settings = vi.hoisted(() => ({ current: {} as Record<string, unknown> })); |
| 5 | |
| 6 | vi.mock("~/hooks/useSettings", () => ({ |
| 7 | getClientSettings: () => settings.current, |
| 8 | useClientSettings: () => undefined, |
| 9 | ensureClientSettingsHydrated: vi.fn(async () => undefined), |
| 10 | })); |
| 11 | |
| 12 | const { getBrowserDefaults } = await import("./browserDefaults"); |
| 13 | |
| 14 | const withDefaultProfile = (browserDefaultProfileId: string) => { |
| 15 | settings.current = { |
| 16 | browserDefaultViewport: { _tag: "fill" }, |
| 17 | browserDefaultZoomFactor: 1, |
| 18 | browserDefaultAppearance: "system", |
| 19 | browserAutoShowFloatingPreview: true, |
| 20 | browserProfiles: [{ id: "work", name: "Work", kind: "persistent" }], |
| 21 | browserDefaultProfileId, |
| 22 | }; |
| 23 | return getBrowserDefaults(); |
| 24 | }; |
| 25 | |
| 26 | describe("getBrowserDefaults profile resolution", () => { |
| 27 | it("refuses incognito as the default", () => { |
| 28 | expect(withDefaultProfile(INCOGNITO_BROWSER_PROFILE_ID).profileId).toBe( |
| 29 | DEFAULT_BROWSER_PROFILE_ID, |
| 30 | ); |
| 31 | }); |
| 32 | }); |