27 lines
935 B
Markdown
27 lines
935 B
Markdown
# E2E testid contract (EventHubFrontAdmin)
|
|
|
|
Селекторы: **`data-testid`** + a11y (`getByRole` / `getByLabel`) где имя стабильно.
|
|
|
|
## Naming
|
|
|
|
| Pattern | Example |
|
|
|---------|---------|
|
|
| `page-{name}` | `page-login`, `page-users` |
|
|
| `nav-{slug}` | `nav-users` (slug = path without `/`) |
|
|
| `{entity}-row-{id}` | `user-row-{uuid}` |
|
|
| `{entity}-detail` | `user-detail` |
|
|
| `{entity}-filter-{field}` | `event-filter-status` |
|
|
| `btn-{action}` | `btn-login`, `btn-save`, `btn-delete-confirm` |
|
|
| `dialog-{name}` | `dialog-edit-user` |
|
|
| `menu-user` | avatar dropdown |
|
|
| `palette-input` | command palette |
|
|
|
|
Helper in app: `src/lib/testid.ts` → `testid(['user-row', id])`.
|
|
|
|
## Rules
|
|
|
|
- kebab-case only
|
|
- Dynamic id segment = real API entity id
|
|
- Prefer roles/labels for login email/password and primary submit when i18n fixed to `ru` in mock suite
|
|
- Do not decorate every layout div — only interaction anchors
|