Skip to content

Add automated test coverage (Vitest, Nuxt Test Utils, Playwright) - #102

Merged
sundancekid73 merged 4 commits into
mainfrom
feature/add-test-coverage
Jul 21, 2026
Merged

Add automated test coverage (Vitest, Nuxt Test Utils, Playwright)#102
sundancekid73 merged 4 commits into
mainfrom
feature/add-test-coverage

Conversation

@sundancekid73

Copy link
Copy Markdown
Collaborator

Summary

  • Add Vitest + Vue Test Utils + @nuxt/test-utils for unit/component tests (tests/unit/, tests/nuxt/) and Playwright for E2E smoke tests (tests/e2e/) - the project previously had zero automated coverage.
  • Starter tests cover the highest-value code found during analysis: the search Pinia store, SearchFilter/SearchInput components, and the search + DE/EN locale-switch user flows (search API mocked at the network layer).
  • New npm scripts: test-website, test-watch-website, test-e2e-website, lint-website (none existed before).
  • New .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.
  • Resyncs pnpm-lock.yaml (it had drifted from package.json) and migrates the deprecated pnpm.onlyBuiltDependencies field from package.json to pnpm-workspace.yaml - both were blocking any pnpm run command before this change.
  • Removes a stray committed .eslintcache and ignores it (and .nuxtrc) going forward.

Note on lint: running eslint surfaced ~60 pre-existing errors (mostly vue/multi-word-component-names on page/layout files, a couple of real parsing errors, and a dead .eslintrc.js left over from before ESLint v9's flat-config switch). That cleanup is out of scope here, so the CI lint step is continue-on-error: true for now rather than immediately red-lining every future PR - worth a follow-up.

Test plan

  • pnpm run test-website - 7 unit/component tests pass
  • pnpm run test-e2e-website - 3 Playwright smoke tests pass
  • pnpm run build-website - production build succeeds
  • Confirm the new ci.yml workflow runs and reports correctly on this PR

🤖 Generated with Claude Code

sundancekid73 and others added 4 commits May 21, 2026 14:57
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>
@sundancekid73
sundancekid73 merged commit 99f74a8 into main Jul 21, 2026
2 checks passed
@sundancekid73
sundancekid73 deleted the feature/add-test-coverage branch July 21, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant