PromptHash Stellar uses Vitest + jsdom + React Testing Library for frontend integration coverage.
yarn test:frontendWatch mode:
yarn test:frontend:watchRun the deterministic browser-level buyer journey:
corepack yarn playwright install chromium # first run only
yarn test:e2eThe Playwright suite starts Vite locally and uses the ?e2e=1 development-only
wallet adapter. It mocks challenge, signing, purchase, unlock, and network
boundaries, so it never requires an extension, testnet RPC, or real funds. The
adapter is excluded from production behavior through Vite's DEV guard.
Prefer real user journeys at the component or page-flow level:
- wallet connection or disconnection state
- wrong-network handling
- create listing validation and submission guards
- purchase and unlock flows
- failure recovery after async errors
- React Query refresh behavior after mutations
- Render the real flow component with
src/test/render.tsx. - Reuse realistic prompt fixtures from
src/test/fixtures/prompts.ts. - Mock wallet, Soroban client, encryption, unlock, and buyer-library API boundaries at the edge:
@/util/wallet@/lib/stellar/promptHashClient@/lib/crypto/promptCrypto@/lib/prompts/unlock@/lib/prompts/library(saved/owned collectionfetchcalls)- draft lifecycle routes (
/api/prompts/creator/:wallet/drafts,/:id/publish)
- Update mocked in-memory state after mutations, then assert the UI refreshes after React Query invalidation.
- Assert both happy-path and failure or recovery behavior.
- Do not depend on live wallet extensions.
- Do not depend on a live Soroban RPC or Horizon server.
- Keep mock responses deterministic.
- Prefer explicit text assertions over snapshots for async marketplace flows.