Skip to content

Commit

Permalink
Update flag tests
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-robert committed Nov 25, 2024
1 parent b9737d1 commit d4ebb74
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/workbench/flags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand All @@ -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);
});
Expand Down

0 comments on commit d4ebb74

Please sign in to comment.