The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { assert, it } from "@effect/vitest"; |
| 2 | import { |
| 3 | WINDOWS_POLICY_GROUPS, |
| 4 | WINDOWS_POLICY_LISTS, |
| 5 | WINDOWS_POLICY_VALUES, |
| 6 | } from "@t3tools/shared/managedPolicyFile"; |
| 7 | |
| 8 | import { macosProfile, windowsAdmx } from "./policyTemplates.ts"; |
| 9 | |
| 10 | it("gives every registry value the Windows reader accepts a Group Policy control", () => { |
| 11 | const admx = windowsAdmx(); |
| 12 | for (const name of Object.keys(WINDOWS_POLICY_VALUES)) { |
| 13 | assert.include(admx, `valueName="${name}"`); |
| 14 | } |
| 15 | for (const key of Object.keys(WINDOWS_POLICY_LISTS)) { |
| 16 | assert.include(admx, `key="SOFTWARE\\Policies\\T3Tools\\T3Code\\${key}"`); |
| 17 | } |
| 18 | for (const name of Object.keys(WINDOWS_POLICY_GROUPS)) { |
| 19 | assert.include(admx, `valueName="${name}"`); |
| 20 | } |
| 21 | }); |
| 22 | |
| 23 | it("refuses a profile for a policy with a null value, which a plist cannot hold", () => { |
| 24 | const profile = macosProfile( |
| 25 | { |
| 26 | schemaVersion: 1, |
| 27 | organization: "Example Corp", |
| 28 | settings: { defaultModelSelection: { value: null, locked: true } }, |
| 29 | }, |
| 30 | { profile: "profile-uuid", payload: "payload-uuid" }, |
| 31 | ); |
| 32 | assert.deepStrictEqual(profile, { |
| 33 | _tag: "Invalid", |
| 34 | reason: |
| 35 | "settings.defaultModelSelection is null, which a configuration profile cannot hold; deploy this policy as a file.", |
| 36 | }); |
| 37 | }); |