Files
antd-admin/apps/with-lingui/.github/instructions/testing.instructions.md
T
zuiidea 39a6339c59 feat(templates): remove orders sample, align basic with with-lingui
- Drop orders routes, API, MSW, and e2e; users-only CRUD template
- Port HTTP refresh, hooks, RouteError, and core e2e to basic
- Lingui extract --clean in script; refresh catalogs
- Update add-resource docs, cursor rule, and optimization spec

Made-with: Cursor
2026-04-27 15:53:47 +08:00

1.1 KiB


applyTo: "e2e//*.ts,e2e//.tsx,src/mocks/**/.ts,playwright.config.ts"

description: "Use when adding or editing tests, Playwright cases, MSW handlers, mock data, or test configuration. Keywords: test, e2e, playwright, mock, msw, coverage."

Testing Instructions

Purpose

Keep tests fast, deterministic, and aligned with core business flows.

Do

  • Prioritize core flows first (auth, users CRUD, permission gates).
  • Keep assertions user-visible and behavior-focused.
  • Reuse existing helper patterns in tests before adding new helpers.
  • Keep mock handlers and mock data synchronized with API schemas.
  • Prefer focused test runs over full-suite runs during iteration.

Do Not

  • Do not add brittle selectors tied to unstable DOM internals.
  • Do not expand fixture data without a clear scenario need.
  • Do not duplicate scenarios already covered by existing tests.

Validation

  • Run focused tests first, then broader checks if needed.
  • Run: pnpm exec vp check --no-fmt
  • Unit / hook logic (Vitest): pnpm run test:unit — tests live under src/**/*.test.ts.