mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-23 23:02:17 +10:00
feat: enable semantic CSS by default
This commit is contained in:
+5
-38
@@ -26,50 +26,18 @@ Run tests:
|
||||
|
||||
`APP_URL=http://localhost:3000 PORT=3000 DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres FLAG_DISABLE_SIGNUPS=false FLAG_DISABLE_EMAIL_AUTH=false FLAG_DISABLE_API_RATE_LIMIT=true LOCAL_STORAGE_PATH=/workspace/data/e2e pnpm test:e2e`
|
||||
|
||||
## Semantic CSS flag matrix
|
||||
## Semantic CSS
|
||||
|
||||
Run the ordinary suite with both Semantic CSS rollout flags disabled:
|
||||
Run opt-in conversion, editing, conflict, last-valid, default-mode, and visual acceptance:
|
||||
|
||||
```bash
|
||||
FLAG_SEMANTIC_CSS_AUTHORING=false FLAG_SEMANTIC_CSS_DEFAULT=false \
|
||||
pnpm exec playwright test --grep-invert "@semantic-css"
|
||||
```
|
||||
|
||||
Run opt-in conversion, editing, conflict, last-valid, and visual acceptance. With authoring enabled, the Playwright
|
||||
configuration automatically uses one worker so deterministic heavy browser preflight and visual checks do not compete
|
||||
for the fixed production five-second deadline:
|
||||
|
||||
```bash
|
||||
FLAG_SEMANTIC_CSS_AUTHORING=true FLAG_SEMANTIC_CSS_DEFAULT=false \
|
||||
pnpm exec playwright test \
|
||||
tests/e2e/specs/semantic-css/legacy-conversion.spec.ts \
|
||||
tests/e2e/specs/semantic-css/invalid-last-valid.spec.ts \
|
||||
tests/e2e/specs/semantic-css/portable-stylesheet.spec.ts \
|
||||
tests/e2e/specs/semantic-css/revision-conflict.spec.ts \
|
||||
tests/e2e/specs/semantic-css/template-visual.spec.ts
|
||||
```
|
||||
|
||||
Verify the default-on state for newly created resumes:
|
||||
|
||||
```bash
|
||||
FLAG_SEMANTIC_CSS_AUTHORING=true FLAG_SEMANTIC_CSS_DEFAULT=true \
|
||||
pnpm exec playwright test tests/e2e/specs/semantic-css/default-mode.spec.ts
|
||||
```
|
||||
|
||||
Verify dormant authoring and persisted semantic rendering:
|
||||
|
||||
```bash
|
||||
FLAG_SEMANTIC_CSS_AUTHORING=false FLAG_SEMANTIC_CSS_DEFAULT=false \
|
||||
pnpm exec playwright test \
|
||||
tests/e2e/specs/semantic-css/dormant-mode.spec.ts \
|
||||
tests/e2e/specs/semantic-css/flag-off-semantic.spec.ts
|
||||
pnpm exec playwright test tests/e2e/specs/semantic-css
|
||||
```
|
||||
|
||||
Linux/Chromium visual baselines are updated intentionally with:
|
||||
|
||||
```bash
|
||||
FLAG_SEMANTIC_CSS_AUTHORING=true FLAG_SEMANTIC_CSS_DEFAULT=false \
|
||||
pnpm exec playwright test tests/e2e/specs/semantic-css/template-visual.spec.ts \
|
||||
pnpm exec playwright test tests/e2e/specs/semantic-css/template-visual.spec.ts \
|
||||
--project=chromium --update-snapshots
|
||||
```
|
||||
|
||||
@@ -80,7 +48,6 @@ FLAG_SEMANTIC_CSS_AUTHORING=true FLAG_SEMANTIC_CSS_DEFAULT=false \
|
||||
- Builder basics edit and autosave persistence.
|
||||
- JSON export/import.
|
||||
- Public sharing for anonymous visitors.
|
||||
- Semantic CSS rollout states, legacy conversion, last-valid recovery, portability, revision conflicts, and all-template
|
||||
visual regression.
|
||||
- Semantic CSS legacy conversion, last-valid recovery, portability, revision conflicts, and all-template visual regression.
|
||||
|
||||
PDF, DOCX, OAuth, passkeys, 2FA, password reset, and AI flows are intentionally outside the initial PR gate.
|
||||
|
||||
@@ -120,6 +120,7 @@ export async function updateSemanticCssFixture(
|
||||
}
|
||||
if (update.legacyStyleRule) {
|
||||
const metadata = data.metadata as Record<string, unknown>;
|
||||
delete metadata.stylesheet;
|
||||
metadata.styleRules = structuredClone(legacyParityRules);
|
||||
}
|
||||
if (update.hidePicture) {
|
||||
|
||||
@@ -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
-11
@@ -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) => {
|
||||
Reference in New Issue
Block a user