From 333c758efa2b1ecc240be9ec9ca13546f1889132 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Tue, 3 Nov 2026 11:02:52 +0100 Subject: [PATCH] test: fail when the desktop repo's policy schema differs from the webmail's --- lib/desktop/__tests__/policy-templates.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/desktop/__tests__/policy-templates.test.ts b/lib/desktop/__tests__/policy-templates.test.ts index ee4c5b8ee..972ea9a3d 100644 --- a/lib/desktop/__tests__/policy-templates.test.ts +++ b/lib/desktop/__tests__/policy-templates.test.ts @@ -44,6 +44,16 @@ describe('the committed templates', () => { }); }); +describe('the desktop repo', () => { + // Only in a checkout with repos/desktop next to the code. CI's desktop repo has no webmail beside it. + const copy = path.join(process.cwd(), 'repos', 'desktop', 'src', 'shared', 'policy-schema.ts'); + + it.runIf(existsSync(copy))('holds the same schema: run node scripts/generate-desktop-policies.mjs --shell repos/desktop', () => { + const text = (file: string) => readFileSync(file, 'utf8').replace(/\r\n/g, '\n'); + expect(text(copy)).toBe(text(path.join(process.cwd(), 'lib', 'desktop', 'policy-schema.ts'))); + }); +}); + describe('the ADMX', () => { const doc = parseXml(generateAdmx()); const root = doc.documentElement;