penpot/frontend/playwright/ui/specs/email-verification.spec.js
Andrey Antukh b660ea9d53 Route the app by query string with screen key
Move SPA routing out of the URL fragment into the normal query
string. The screen travels in a reserved `screen` key holding
the route name (`?screen=workspace&team-id=…`); every other
param keeps its name. `rt/nav` and `rt/resolve` keep their
signatures.

This deletes the fragment-mirroring URL surgery, simplifies
link-preview (the server sees everything) and nginx (single
path, no SPA fallback rules needed), and migrates OIDC
redirects, email links, e2e helpers and plugin test utils to
the new format.

Legacy `#/…` URLs translate client-side for one Penpot version
(`legacy-routes`, marked TODO(next-version)); non-SPA paths
are untouched.

AI-assisted-by: muse-spark-1.3-contributor
2026-09-15 17:10:54 +02:00

46 lines
1.6 KiB
JavaScript

import { test, expect } from "@playwright/test";
import { RegisterPage } from "../pages/RegisterPage";
// Regression test for the bug where a freshly verified account (whose
// profile never had a theme persisted) ended up with an empty string as
// its theme instead of falling back to the dark default: the workspace
// switched to light mode and Settings > UI Theme showed a blank field.
test.beforeEach(async ({ page }) => {
await RegisterPage.initWithLoggedOutUser(page);
});
test.describe("Email verification", () => {
test("Newly verified account defaults to the dark theme", async ({
page,
}) => {
const registerPage = new RegisterPage(page);
await registerPage.setupEmailVerificationSuccess();
await registerPage.goToVerifyToken();
await page.waitForURL(/screen=dashboard/);
// `default` is the body class applied for dark theme, `light` for
// light theme (see app.util.theme/set-color-scheme).
await expect(page.locator("body")).toHaveClass(/default/);
await expect(page.locator("body")).not.toHaveClass(/light/);
});
test("Settings > UI Theme shows Penpot Dark (default) selected, not blank", async ({
page,
}) => {
const registerPage = new RegisterPage(page);
await registerPage.setupEmailVerificationSuccess();
await registerPage.goToVerifyToken();
await page.waitForURL(/screen=dashboard/);
await page.goto("/?screen=settings-options");
// The language select is the first combobox on the page, the theme
// select is the second one.
const themeSelect = page.getByRole("combobox").nth(1);
await expect(themeSelect).toHaveText("Penpot Dark (default)");
});
});