The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | import * as Schema from "effect/Schema"; |
| 3 | |
| 4 | import { RelayDeviceRegistrationRequest } from "./relay.ts"; |
| 5 | |
| 6 | const decodeDevice = Schema.decodeUnknownExit(RelayDeviceRegistrationRequest); |
| 7 | const device = { |
| 8 | deviceId: "device", |
| 9 | label: "Phone", |
| 10 | pushToken: "token", |
| 11 | preferences: { |
| 12 | notificationsEnabled: true, |
| 13 | liveActivitiesEnabled: true, |
| 14 | notifyOnApproval: true, |
| 15 | notifyOnInput: true, |
| 16 | notifyOnCompletion: true, |
| 17 | notifyOnFailure: true, |
| 18 | }, |
| 19 | }; |
| 20 | |
| 21 | describe("mobile device platforms", () => { |
| 22 | it("rejects missing platform versions and Apple activity tokens on Android", () => { |
| 23 | expect(decodeDevice({ ...device, platform: "ios" })._tag).toBe("Failure"); |
| 24 | expect(decodeDevice({ ...device, platform: "android" })._tag).toBe("Failure"); |
| 25 | expect( |
| 26 | decodeDevice({ |
| 27 | ...device, |
| 28 | platform: "android", |
| 29 | androidApiLevel: 36, |
| 30 | pushToStartToken: "apple-token", |
| 31 | })._tag, |
| 32 | ).toBe("Failure"); |
| 33 | }); |
| 34 | }); |