Skip to content

Increase test coverage#41

Merged
iulusoy merged 3 commits into
mainfrom
increase-test-coverage
Mar 26, 2026
Merged

Increase test coverage#41
iulusoy merged 3 commits into
mainfrom
increase-test-coverage

Conversation

@iulusoy
Copy link
Copy Markdown
Member

@iulusoy iulusoy commented Mar 25, 2026

  • unit tests
  • E2E tests
  • some cleanup
  • tests generated with the help of Cursor

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-testid hooks 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 localhost TLS key/cert from src/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.

Comment thread src/frontend/playwright.config.ts Outdated
Comment thread src/frontend/src/lib/i18n/index.test.ts Outdated
Comment on lines +24 to +31
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();
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@iulusoy iulusoy merged commit de1687d into main Mar 26, 2026
4 checks passed
@iulusoy iulusoy deleted the increase-test-coverage branch March 26, 2026 06:58
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.

2 participants