Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable PWA on production #1195

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const allFlags: FlagMetadata[] = [
{ name: "noWelcome", defaultOnStages: ["local", "REVIEW"] },
{
name: "pwa",
defaultOnStages: ["local", "REVIEW", "STAGING"],
defaultOnStages: ["REVIEW", "STAGING", "PRODUCTION"],
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/simulator/Simulator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Simulator = ({
const [brand500] = useToken("colors", ["brand.500"]);
const url = useMemo(() => {
const production =
"https://python-simulator.usermbit.org/v/0.1/simulator.html";
"https://python-simulator.usermbit.org/v/0.1/simulator.html?flag=sw";
const staging =
"https://python-simulator.usermbit.org/staging/simulator.html?flag=sw";

Expand Down
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