From 1cd20bed2cb00f81c44032b05ae1d5148be64879 Mon Sep 17 00:00:00 2001 From: Mohamed Fadl Date: Mon, 2 Nov 2026 05:46:59 +0200 Subject: [PATCH 1/7] Add browser conversion, upload/download, and recovery regression coverage --- .github/workflows/ci.yml | 15 +- README.md | 6 + app/components/color/FormatCard.vue | 1 + app/components/file/ConversionSettings.vue | 1 + app/components/file/FileUploader.vue | 1 + test/e2e/conversion-flow.test.ts | 208 +++++++++++++++++++++ test/e2e/file-converter.test.ts | 19 +- test/e2e/home.test.ts | 21 ++- test/e2e/navigation.test.ts | 19 +- vitest.config.e2e.ts | 15 +- 10 files changed, 280 insertions(+), 26 deletions(-) create mode 100644 test/e2e/conversion-flow.test.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e4e72c..db304d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: [main] pull_request: - branches: [main] + branches: [main, fix/color-conversion-safety] jobs: lint: @@ -42,3 +42,16 @@ jobs: cache: 'npm' - run: npm ci - run: npm run test + + e2e: + name: Browser conversion regressions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + - run: npm ci + - run: npx playwright-core install --with-deps chromium + - run: npm run test:e2e diff --git a/README.md b/README.md index 57f521d..27ea2f3 100644 --- a/README.md +++ b/README.md @@ -159,3 +159,9 @@ Made with ❤️ using [Nuxt](https://nuxt.com) and [culori](https://culorijs.or ## Batch conversion boundaries Batch conversion parses CSS and brace-based SCSS declarations, including nested rules and SCSS variable values. Selectors, comments, strings, URLs, and interpolation spans are preserved. Indented `.sass` is not supported; export it as `.scss` or CSS first. Literal colors alongside interpolation and inside var()/env() fallbacks are converted. Invalid stylesheets show an error instead of producing a partially converted file. Parsing and conversion run in a cancellable Web Worker, and stale results are discarded when files or settings change. + +## Browser regression suite + +Install Chromium with `npx playwright-core install --with-deps chromium`, then run `npm run test:e2e`. Browser tests run in Vitest's Node environment against the built app, using real input/conversion/worker/upload/download flows. A controlled worker stub is used only to deterministically deliver a late stale result after reset; conversion/download assertions use the real worker. CI runs the browser suite for main-target and stacked fixes-target PRs. + +This E2E branch is stacked on `fix/color-conversion-safety`; review and merge the functional fixes first. Local browser execution may require network access for the Playwright browser download. diff --git a/app/components/color/FormatCard.vue b/app/components/color/FormatCard.vue index 8dc377b..d092dc5 100644 --- a/app/components/color/FormatCard.vue +++ b/app/components/color/FormatCard.vue @@ -40,6 +40,7 @@ async function copyToClipboard() {