Skip to main content

Documentation 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.

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 same tests/ directory and can run natively or inside Docker for a clean CI-equivalent environment.

Unit Tests (Vitest)

Unit tests live in tests/unit/ and are run with:
bun run test:unit
Vitest is configured via vitest.config.ts using getViteConfig from Astro so the same module resolution applies in tests as in the app itself.

Unit Test Files

FileWhat it covers
accepted-order-sorting.spec.tsSorting logic for accepted orders
default-route.spec.tsDefault route redirect behaviour
delivery-availability.spec.tsWhether a delivery slot is available
delivery-status-flow.spec.tsValid delivery status transitions
messenger-accept-eligibility.spec.tsRules for a courier accepting an order
messenger-collection-summary.spec.tsCash collection summary calculation
messenger-money-format.spec.tsCurrency formatting helpers
messenger-order-visibility.spec.tsWhich orders a courier can see

E2E Tests (Playwright)

End-to-end tests live in tests/ (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:
FIRESTORE_EMULATOR_HOST=127.0.0.1:8180
FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9199
PUBLIC_APP_ENV=development

E2E Test Files

FileFeature area
auth/login.spec.tsAuthentication and login flow
cart/cart.spec.tsShopping cart operations
courier/courier-smoke.spec.tsCourier delivery smoke tests
favorites/favorites.spec.tsFavorites add/remove
home/home.spec.tsHome page rendering
orders/failed-orders.spec.tsFailed order handling
orders/my-orders.spec.tsOrder history view
products/product-detail.spec.tsProduct detail page
products/product-list.spec.tsProduct listing and filters
profile/profile.spec.tsUser profile page
review/post.spec.tsPosting a product review

Running Tests

Native Setup

1

Install prerequisites

You need Bun, Java 21 (required for the Firestore emulator), and the Playwright browser binaries.
bun install
bunx playwright install --with-deps
2

Start Firebase emulators

The E2E suite requires Firestore and Auth emulators to be running before Playwright starts:
bun run emu
3

Run the tests

bunx playwright test
4

View the HTML report

bunx playwright show-report

Docker Setup

Docker gives you a clean, isolated environment that matches CI exactly. The Dockerfile.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.
1

Build and run all tests

docker compose up testing
2

Run a specific test file inside Docker

docker compose run --rm testing bunx playwright test tests/auth/login.spec.ts
3

View the report on your host machine

Because playwright-report/ is a shared volume, you can open the report generated inside Docker with your native Playwright installation:
bunx playwright show-report
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

The playwright.config.ts detects the CI environment variable and adjusts automatically:
SettingLocalCI
Retries02
WorkersCPU auto4
Reporterlist + HTMLdot + JUnit + JSON
forbidOnlyfalsetrue
Set ENABLE_DEV_ADMIN_BYPASS=true and DEV_ADMIN_UID in your local .env to skip Firebase Auth token verification during development testing. Never enable this in production.

Build docs developers (and LLMs) love