From d4ebb74afa7f779fdada483e2546da90094251f4 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Mon, 25 Nov 2024 17:33:47 +0000 Subject: [PATCH] Update flag tests --- src/workbench/flags.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/workbench/flags.test.ts b/src/workbench/flags.test.ts index a9e399559..455f2144c 100644 --- a/src/workbench/flags.test.ts +++ b/src/workbench/flags.test.ts @@ -14,12 +14,15 @@ describe("flags", () => { expect(flags.dndDebug).toEqual(false); }); - it("enables nothing in production", () => { + it("only enables PWA in production", () => { const params = new URLSearchParams([]); const flags = flagsForParams("PRODUCTION", params); - expect(Object.values(flags).every((x) => !x)).toEqual(true); + expect(flags.pwa).toBe(true); + const { pwa, ...filteredFlags } = flags; + + expect(Object.values(filteredFlags).every((x) => !x)).toEqual(true); }); it("enable specific flag", () => { @@ -29,7 +32,7 @@ describe("flags", () => { expect( Object.entries(flags).every( - ([flag, status]) => (flag === "noWelcome") === status + ([flag, status]) => (flag === "noWelcome" || flag === "pwa") === status ) ).toEqual(true); });