SansiStore has two complementary test suites: fast, isolated unit tests powered by Vitest, and full browser-driven end-to-end tests powered by Playwright. Both suites share the sameDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ProcesosAgilesUMSS/sansistore/llms.txt
Use this file to discover all available pages before exploring further.
tests/ directory and can run natively or inside Docker for a clean CI-equivalent environment.
Unit Tests (Vitest)
Unit tests live intests/unit/ and are run with:
vitest.config.ts using getViteConfig from Astro so the same module resolution applies in tests as in the app itself.
Unit Test Files
| File | What it covers |
|---|---|
accepted-order-sorting.spec.ts | Sorting logic for accepted orders |
default-route.spec.ts | Default route redirect behaviour |
delivery-availability.spec.ts | Whether a delivery slot is available |
delivery-status-flow.spec.ts | Valid delivery status transitions |
messenger-accept-eligibility.spec.ts | Rules for a courier accepting an order |
messenger-collection-summary.spec.ts | Cash collection summary calculation |
messenger-money-format.spec.ts | Currency formatting helpers |
messenger-order-visibility.spec.ts | Which orders a courier can see |
E2E Tests (Playwright)
End-to-end tests live intests/ (excluding tests/unit/) and target a real running dev server backed by Firebase emulators. Playwright is configured in playwright.config.ts with baseURL: http://127.0.0.1:4321 and runs across Chromium, Firefox, and WebKit in parallel.
The web server is started automatically by Playwright (bun run dev) with emulator environment variables injected:
E2E Test Files
| File | Feature area |
|---|---|
auth/login.spec.ts | Authentication and login flow |
cart/cart.spec.ts | Shopping cart operations |
courier/courier-smoke.spec.ts | Courier delivery smoke tests |
favorites/favorites.spec.ts | Favorites add/remove |
home/home.spec.ts | Home page rendering |
orders/failed-orders.spec.ts | Failed order handling |
orders/my-orders.spec.ts | Order history view |
products/product-detail.spec.ts | Product detail page |
products/product-list.spec.ts | Product listing and filters |
profile/profile.spec.ts | User profile page |
review/post.spec.ts | Posting a product review |
Running Tests
Native Setup
Install prerequisites
You need Bun, Java 21 (required for the Firestore emulator), and the Playwright browser binaries.
Start Firebase emulators
The E2E suite requires Firestore and Auth emulators to be running before Playwright starts:
Docker Setup
Docker gives you a clean, isolated environment that matches CI exactly. TheDockerfile.testing image is based on mcr.microsoft.com/playwright:v1.59.1-noble with Java 21 and Bun added on top. Source files, tests, and report output directories are bind-mounted from the host so you can inspect results without copying files out of the container.
In CI, Playwright is configured with
retries: 2, workers: 4, and outputs both JUnit XML (junit-result/results.xml) and JSON (junit-result/results.json) reports for pipeline dashboards.CI Behaviour
Theplaywright.config.ts detects the CI environment variable and adjusts automatically:
| Setting | Local | CI |
|---|---|---|
| Retries | 0 | 2 |
| Workers | CPU auto | 4 |
| Reporter | list + HTML | dot + JUnit + JSON |
forbidOnly | false | true |