Increase test coverage#41
Conversation
iulusoy
commented
Mar 25, 2026
- unit tests
- E2E tests
- some cleanup
- tests generated with the help of Cursor
There was a problem hiding this comment.
Pull request overview
This PR increases automated test coverage for the SvelteKit frontend by adding new Playwright E2E smoke/flow tests and Vitest unit tests, plus wiring coverage artifacts into CI. It also cleans up repository contents by removing committed localhost TLS materials.
Changes:
- Added Playwright smoke tests for key routes and a donation wizard E2E flow; added
data-testidhooks to pages/components to support stable selectors. - Added Vitest unit tests for i18n, db BUILD_MODE branching, and schema exports; enabled Vitest coverage generation and artifact upload in CI.
- Removed committed
localhostTLS key/cert fromsrc/nginx/keys/and updated ignore rules for coverage output.
Reviewed changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/nginx/keys/localhost.key | Removed committed localhost private key. |
| src/nginx/keys/localhost.crt | Removed committed localhost certificate. |
| src/frontend/tests/test.spec.ts | Added route smoke tests + simplified existing home assertion. |
| src/frontend/tests/donation-flow.spec.ts | Added E2E coverage for donation wizard modal flow. |
| src/frontend/src/routes/+page.svelte | Added data-testid hook for home page wrapper. |
| src/frontend/src/routes/about/+page.svelte | Added data-testid hook for About page. |
| src/frontend/src/routes/blog/+page.svelte | Added data-testid hook for Blog page. |
| src/frontend/src/routes/contact/+page.svelte | Added data-testid hook for Contact page. |
| src/frontend/src/routes/donation/+page.svelte | Added data-testid hooks for donation page and modal/controls used by E2E tests. |
| src/frontend/src/routes/faq/+page.svelte | Added data-testid hook for FAQ page. |
| src/frontend/src/routes/team/+page.svelte | Added data-testid hook for Team page. |
| src/frontend/src/routes/tutorial/+page.svelte | Added data-testid hook for Tutorial page. |
| src/frontend/src/lib/server/schema.test.ts | Added basic unit coverage for schema exports. |
| src/frontend/src/lib/server/db.test.ts | Added unit coverage for BUILD_MODE db branching behavior. |
| src/frontend/src/lib/i18n/index.test.ts | Added unit coverage for translation helper behavior. |
| src/frontend/playwright.config.ts | Updated webServer strategy and set baseURL for relative navigations. |
| src/frontend/package.json | Added Vitest coverage dependency. |
| src/frontend/pnpm-lock.yaml | Updated lockfile for new dependency and resolved versions. |
| .gitignore | Ignored frontend coverage output and added a temp ignore pattern. |
| .github/workflows/frontend-CI.yml | Added unit test + coverage steps and uploaded coverage/report artifacts. |
Files not reviewed (1)
- src/frontend/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| describe('db module BUILD_MODE branching', () => { | ||
| beforeEach(() => { | ||
| vi.resetModules(); | ||
| delete process.env.BUILD_MODE; | ||
|
|
||
| if (typeof drizzleImpl?.mockClear === 'function') drizzleImpl.mockClear(); | ||
| if (typeof drizzleMockFn?.mockClear === 'function') drizzleMockFn.mockClear(); | ||
| if (typeof createPoolFn?.mockClear === 'function') createPoolFn.mockClear(); |
There was a problem hiding this comment.
These tests mutate process env (MYSQL_) but only clear BUILD_MODE in beforeEach(). This can leak state to other test files and make failures order-dependent. Consider capturing the original env in beforeEach and restoring it in afterEach, or explicitly deleting any MYSQL_ keys you set.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|


