feat: enable semantic CSS by default

This commit is contained in:
Amruth Pillai
2026-07-30 16:28:44 +02:00
parent 1ee24e5a9f
commit 3589b534f5
19 changed files with 46 additions and 1696 deletions
@@ -1,9 +1,7 @@
import { createSemanticCssResume, readStylesheetSource } from "../../fixtures/semantic-css";
import { expect, test } from "../../fixtures/test";
test("@semantic-css starts new resumes in semantic mode when default-on is enabled", async ({
authPage: page,
}, testInfo) => {
test("@semantic-css starts new resumes in semantic mode", async ({ authPage: page }, testInfo) => {
await createSemanticCssResume(page, testInfo);
await expect(page.getByText("Converted stylesheet draft", { exact: true })).toHaveCount(0);
@@ -1,29 +0,0 @@
import { updateSemanticCssFixture } from "../../fixtures/db";
import { createSampleResumeFromDashboard, openSidebarSection } from "../../fixtures/resume";
import { resumeIdFromPage, waitForStablePreview } from "../../fixtures/semantic-css";
import { expect, test } from "../../fixtures/test";
test("@semantic-css keeps persisted semantic rendering active when authoring is off", async ({
authPage: page,
}, testInfo) => {
await createSampleResumeFromDashboard(page, testInfo);
const beforeCanvas = await waitForStablePreview(page);
const before = await beforeCanvas.evaluate((element) => (element as HTMLCanvasElement).toDataURL());
const source = { languageVersion: 1, text: "@version 1;\nname { color: #2563eb; font-size: 30pt; }\n" };
await updateSemanticCssFixture(resumeIdFromPage(page), {
stylesheet: { mode: "semantic", source, applied: source },
});
await page.reload();
const afterCanvas = await waitForStablePreview(page);
await expect
.poll(() => afterCanvas.evaluate((element) => (element as HTMLCanvasElement).toDataURL()))
.not.toBe(before);
await waitForStablePreview(page);
await openSidebarSection(page, "Custom Styles");
await expect(page.getByText("Semantic styles remain active", { exact: true })).toBeVisible();
await expect(
page.getByText("This instance does not currently allow Semantic CSS editing.", { exact: true }),
).toBeVisible();
await expect(page.getByLabel("Target Scope")).toHaveCount(0);
});
@@ -1,18 +1,8 @@
import { readSemanticCssFixture, updateSemanticCssFixture } from "../../fixtures/db";
import { createSampleResumeFromDashboard, openSidebarSection } from "../../fixtures/resume";
import { createSampleResumeFromDashboard } from "../../fixtures/resume";
import { resumeIdFromPage } from "../../fixtures/semantic-css";
import { expect, test } from "../../fixtures/test";
test("@semantic-css keeps the legacy editor available while both flags are off", async ({
authPage: page,
}, testInfo) => {
await createSampleResumeFromDashboard(page, testInfo);
await openSidebarSection(page, "Custom Styles");
await expect(page.getByLabel("Target Scope")).toBeVisible();
await expect(page.getByRole("textbox", { name: "Semantic CSS stylesheet" })).toHaveCount(0);
});
test("@semantic-css preserves a persisted stylesheet through an old-client resume update", async ({
authPage: page,
}, testInfo) => {