test: comprehensive test suite and route refactoring #64

Merged
addison merged 20 commits from :testing-and-quality into main 2026-01-10 20:37:40 -05:00
Contributor

Summary

Adds comprehensive test coverage and refactors item management routes for cleaner architecture.

Changes

Testing Infrastructure

  • Add comprehensive tests README with guidelines
  • Add unit tests for components (Button, Card, ErrorAlert, Spinner)
  • Add unit tests for modules (auth, categories, errors, globals)
  • Add E2E tests for navigation, home page, auth, items browsing, vendor profiles
  • Add security validation tests for routes, input validation, storage paths
  • Add item creation flow and form validation tests
  • Add image upload constraint and validation tests

Route Refactoring

  • Move /items/new/my/items/new
  • Move /items/manage/my/items/
  • Move /items/[id]/edit/my/items/[id]/edit
  • Simplify auth by removing protectedRoutes and protectedRoutePatterns
  • User management routes now protected by directory structure (/my/*)

Code Quality

  • Remove unused LOGIN_REQUIRED constant
  • Eliminate eslint-disable comments in tests
  • Fix lint errors in test files

Test Results

  • 276 unit tests pass
  • 76 E2E tests pass
  • All lint/type/format checks pass

Notes

  • This makes routing simpler: /items/* is public for browsing, /my/* is protected for user management
  • Updates MVP spec to mark testing tasks complete
## Summary Adds comprehensive test coverage and refactors item management routes for cleaner architecture. ## Changes ### Testing Infrastructure - Add comprehensive tests README with guidelines - Add unit tests for components (Button, Card, ErrorAlert, Spinner) - Add unit tests for modules (auth, categories, errors, globals) - Add E2E tests for navigation, home page, auth, items browsing, vendor profiles - Add security validation tests for routes, input validation, storage paths - Add item creation flow and form validation tests - Add image upload constraint and validation tests ### Route Refactoring - Move `/items/new` → `/my/items/new` - Move `/items/manage` → `/my/items/` - Move `/items/[id]/edit` → `/my/items/[id]/edit` - Simplify auth by removing `protectedRoutes` and `protectedRoutePatterns` - User management routes now protected by directory structure (`/my/*`) ### Code Quality - Remove unused `LOGIN_REQUIRED` constant - Eliminate eslint-disable comments in tests - Fix lint errors in test files ## Test Results - ✅ 276 unit tests pass - ✅ 76 E2E tests pass - ✅ All lint/type/format checks pass ## Notes - This makes routing simpler: `/items/*` is public for browsing, `/my/*` is protected for user management - Updates MVP spec to mark testing tasks complete
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
- Add protectedRoutes array for static protected paths under public prefixes
- Add protectedRoutePatterns for dynamic route patterns (regex)
- Update middleware to check protected routes before public prefix matching
- Update tests to verify protected routes redirect to login

Co-authored-by: Shelley <shelley@exe.dev>
refactor: move item management routes to /my/items/
Some checks failed
ci.yml / refactor: move item management routes to /my/items/ (pull_request) Failing after 0s
cccf2c32d1
- Move /items/new to /my/items/new
- Move /items/manage to /my/items/
- Move /items/[id]/edit to /my/items/[id]/edit
- Simplify auth by removing protectedRoutes and protectedRoutePatterns
- User management routes are now protected by directory structure (/my/*)
- Update all references: dashboard, item detail, manage buttons
- Update e2e tests for new route structure
- Update unit tests to reflect simplified auth config

This makes the routing simpler: /items/* is public for browsing,
/my/* is protected for user management.

Co-authored-by: Shelley <shelley@exe.dev>
test: fix auth verify test and silence themeManager test noise
Some checks failed
ci.yml / test: fix auth verify test and silence themeManager test noise (pull_request) Failing after 0s
971b8aa6bf
- Fix verify page test: page redirects to login without email context
- Mock auth module in themeManager tests to prevent Supabase client errors

Co-authored-by: Shelley <shelley@exe.dev>
test: add verify page test with email context
Some checks failed
ci.yml / test: add verify page test with email context (pull_request) Failing after 0s
9712f3c083
Co-authored-by: Shelley <shelley@exe.dev>
Merge branch 'main' into testing-and-quality
Some checks failed
ci.yml / Merge branch 'main' into testing-and-quality (pull_request) Failing after 0s
fe8e3bd777
chore: add nix flake for playwright with chromium-only e2e tests on nixos
Some checks failed
ci.yml / chore: add nix flake for playwright with chromium-only e2e tests on nixos (pull_request) Failing after 0s
ci.yml / test: comprehensive test suite and route refactoring (#64) (pull_request) Failing after 0s
9df46ebbfd
- Add flake.nix/flake.lock for playwright browser management via nix
- Disable firefox/webkit in playwright.config (only chromium in nix flake)
- Add test-e2e-nix recipe for running tests on NixOS
- Update playwright config timeouts for better stability
addison deleted branch testing-and-quality 2026-01-10 20:37:41 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kwila/market!64
No description provided.