원클릭으로
frontend-testing
React frontend tests. Use when writing, editing, or reviewing component, flow, or hook tests in *.test.tsx files.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
React frontend tests. Use when writing, editing, or reviewing component, flow, or hook tests in *.test.tsx files.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Skill writing principles. Use when creating, editing, or reviewing any SKILL.md.
Skill rule extraction and creation. Use when the user says /learn.
Kysely database queries. Use when writing, reviewing, or debugging Kysely selects, mutations, joins, transactions, filters, or aggregates.
Frontend components and Tailwind. Use when creating, reviewing, refactoring, splitting, or organizing React components, shared components, component folders, or Tailwind classes.
TanStack Query in React. Use when implementing or reviewing queries, mutations, invalidation, or query hooks.
Lint and optimize existing skills. Use when the user says /skill-linter.
| name | frontend-testing |
| description | React frontend tests. Use when writing, editing, or reviewing component, flow, or hook tests in *.test.tsx files. |
Components publish observable state through raw data-* attributes. Tests consume that contract through DOM-first helpers.
No role/text queries, no assertions on formatted text, no CSS/class assertions.
Components with tests publish data-component="kebab-name" on the root element.
Observable state becomes raw data-* attributes:
Pass values directly unless conversion is genuinely required by the source value. Do not stringify booleans or numbers manually. Do not turn absence into null, "null", "undefined", or "".
data-active={response.active}
data-id={response?.id}
Visual formatting stays in JSX. Tests assert on raw dataset values.
Use entity-specific IDs: data-media-id, data-download-id, data-release-id. Never data-id.
Interactive children publish data-slot="semantic-name" scoped by the parent.
Only publish attributes a test consumes. Add a new attribute in the same change as the test that uses it. If the last consumer disappears, remove the attribute.
Use the project DOM helpers, usually get, query, and slot from tests/web/dom.ts.
get(component, filters?): returns exactly one element or throws.query(component, filters?): returns one element, null, or throws on many.slot(parent, name): returns a named child slot.DOM attributes are strings in filters: { ratio: "0.65" }, not { ratio: 0.65 }.
Use the project testing-library wrapper, usually tests/web/testing-library.ts. It should expose only approved APIs such as render, renderHook, waitFor, fireEvent, userEvent, cleanup, and act.
Do not import directly from @testing-library/react or @testing-library/user-event.
Harnesses provide context, not behavior: providers, router, query client, stores, seeded data, and boundary HTTP.
Do not duplicate production ownership in a harness. If behavior belongs to a hook, route, store, or parent, test through that owner. Test a leaf directly only for behavior the leaf owns.
HTTP mocking is project-specific. Use the project boundary strategy.
Do not use:
document.querySelector / document.querySelectorAllscreen.*getByRole, findByText, getByLabelText, or any *By* queryIf you miss a *By* query, the component is missing an observable data-* contract.
See examples.md for component, flow, hook, waiting, absence, and multiple-element examples.