@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 36 lines 1.35 KB
Raw
1 import { describe, expect, it } from "vite-plus/test";
2 import * as Option from "effect/Option";
3
4 import {
5 newEasDeviceHost,
6 parseEasDeviceHostDraft,
7 updateEasDeviceHosts,
8 } from "./easDeviceHostsSettings.logic";
9
10 describe("Expo device host settings", () => {
11 it("rejects limits Expo does not allow", () => {
12 expect(Option.isSome(parseEasDeviceHostDraft(newEasDeviceHost("eas")))).toBe(true);
13 expect(
14 Option.isNone(parseEasDeviceHostDraft({ ...newEasDeviceHost("eas"), maxSessionMinutes: 10 })),
15 ).toBe(true);
16 expect(
17 Option.isNone(
18 parseEasDeviceHostDraft({ ...newEasDeviceHost("eas"), maxSessionMinutes: 600 }),
19 ),
20 ).toBe(true);
21 expect(Option.isNone(parseEasDeviceHostDraft({ ...newEasDeviceHost("eas"), label: " " }))).toBe(
22 true,
23 );
24 });
25
26 it("keeps each environment's own token when a save leaves the token unchanged", () => {
27 const edited = { ...newEasDeviceHost("eas"), label: "Renamed", accessToken: "" };
28 const elsewhere = { ...newEasDeviceHost("eas"), accessToken: "••••••" };
29 expect(updateEasDeviceHosts([elsewhere], edited, false, true)).toEqual([
30 { ...edited, accessToken: "••••••" },
31 ]);
32 expect(updateEasDeviceHosts([], { ...edited, accessToken: "••••••" }, false, true)).toEqual([
33 { ...edited, accessToken: "" },
34 ]);
35 });
36 });