Skip to content

ci(web): gate vitest in CI + fix stale frontend test mocks; drop stray lib/ gitignore rule#103

Merged
ravirajsinh45 merged 1 commit into
mainfrom
chore/frontend-ci-and-gitignore
Jul 7, 2026
Merged

ci(web): gate vitest in CI + fix stale frontend test mocks; drop stray lib/ gitignore rule#103
ravirajsinh45 merged 1 commit into
mainfrom
chore/frontend-ci-and-gitignore

Conversation

@ravirajsinh45

Copy link
Copy Markdown
Contributor

What & why

The frontend vitest suite was never run in CI (only tsc + next build), so ~5 stale-mock failures sat red unnoticed. This gates the suite, fixes the failures, and removes a .gitignore rule that was silently ignoring apps/web/lib/.

Changes

CI gate — add a blocking Run tests step (pnpm test = vitest run) to the Frontend Build job.

Fix pre-existing failures (source evolved, mocks didn't):

  • lib/__tests__/api.test.tsrequest() reads response.text(); mocks only had .json(). Added .text() to the 3 success mocks.
  • stores/__tests__/notification-store.test.ts — store calls api.post('/me/notifications/…'); test mocked api.patch on old /notifications/… paths. Mock post + match the store.

gitignore — remove lib/ / lib64/ (Python-template leftovers) that matched apps/web/lib/.

Verification

  • vitest run: 13 files, 113 tests pass (5 were failing).
  • git check-ignore apps/web/lib/* now returns nothing; CI YAML validated.

No CHANGELOG entry — internal CI/test tooling, not user-facing.

Merge order

Independent of the storage-cap stack (#98#102) — recommend merging this first, then rebasing the stack onto the new main so its branches inherit the vitest gate + fixes.

…cks; drop stray lib/ gitignore rule

- Add a blocking 'Run tests' (pnpm test = vitest run) step to the Frontend Build job — the
  frontend suite was never run in CI, so ~5 stale-mock failures went unnoticed.
- Fix them: api.test.ts fetch mocks now provide .text() (request() reads response.text());
  notification-store.test.ts mocks api.post and matches the store's /me/notifications/* paths.
- Remove '.gitignore' lib/ and lib64/ (Python-template leftovers) that were ignoring apps/web/lib/.
@ravirajsinh45 ravirajsinh45 merged commit 8ed2369 into main Jul 7, 2026
4 checks passed
@ravirajsinh45 ravirajsinh45 deleted the chore/frontend-ci-and-gitignore branch July 7, 2026 05:27
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