Add automated test coverage (Vitest, Nuxt Test Utils, Playwright) - #102
Merged
Conversation
Creates proxy network if needed, then starts website containers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces a Vitest/Vue Test Utils/@nuxt/test-utils setup for unit and component tests plus Playwright for E2E smoke tests, since the project had zero automated coverage. Adds starter tests on the highest-value code (the search store, search filter/input components, and the search/i18n user flows), new lint/test npm scripts, and a CI workflow to run them on push/PR. Also resyncs pnpm-lock.yaml and migrates the deprecated package.json `pnpm.onlyBuiltDependencies` field to pnpm-workspace.yaml, both of which were blocking any `pnpm run` command. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The stage/production Docker builds started failing after the previous commit added pnpm-workspace.yaml: the Dockerfile only copied package.json before running `pnpm install`, so the initial install never saw pnpm-workspace.yaml/.npmrc. Once `COPY . .` revealed them, pnpm detected a hoist/build-approval config drift and tried to interactively purge node_modules, which fails with no TTY in a Docker build. Root cause was two-fold: also, `corepack use pnpm@10.21.0` only pins the version in the in-container package.json, which the following `COPY . .` immediately overwrites with the committed (unpinned) one - so the later `pnpm run generate-website` silently downloaded whatever pnpm was latest (11.15.1) instead of 10.21.0, guaranteeing a version mismatch with the initial install. Fixed by copying the lockfile/config before installing, and pinning the version durably via package.json's "packageManager" field so it survives the COPY. Verified with a local `docker build`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rage # Conflicts: # pnpm-lock.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@nuxt/test-utilsfor unit/component tests (tests/unit/,tests/nuxt/) and Playwright for E2E smoke tests (tests/e2e/) - the project previously had zero automated coverage.SearchFilter/SearchInputcomponents, and the search + DE/EN locale-switch user flows (search API mocked at the network layer).test-website,test-watch-website,test-e2e-website,lint-website(none existed before)..github/workflows/ci.yml: runs lint (non-blocking - see note below), unit/component tests, and a build on every push/PR, plus a separate Playwright job. Existing deploy-on-tag workflows are untouched.pnpm-lock.yaml(it had drifted frompackage.json) and migrates the deprecatedpnpm.onlyBuiltDependenciesfield frompackage.jsontopnpm-workspace.yaml- both were blocking anypnpm runcommand before this change..eslintcacheand ignores it (and.nuxtrc) going forward.Note on lint: running
eslintsurfaced ~60 pre-existing errors (mostlyvue/multi-word-component-nameson page/layout files, a couple of real parsing errors, and a dead.eslintrc.jsleft over from before ESLint v9's flat-config switch). That cleanup is out of scope here, so the CI lint step iscontinue-on-error: truefor now rather than immediately red-lining every future PR - worth a follow-up.Test plan
pnpm run test-website- 7 unit/component tests passpnpm run test-e2e-website- 3 Playwright smoke tests passpnpm run build-website- production build succeedsci.ymlworkflow runs and reports correctly on this PR🤖 Generated with Claude Code