Testing Library patterns for React component testing — queries, user events,
99
99%
Does it follow best practices?
Impact
100%
1.03xAverage score across 8 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent correctly uses userEvent for realistic user interaction simulation in a form-submission test, sets it up properly, and queries elements using accessibility-first selectors rather than brittle alternatives.",
"type": "weighted_checklist",
"checklist": [
{
"name": "userEvent import",
"description": "Imports userEvent from '@testing-library/user-event' (not from another package)",
"max_score": 8
},
{
"name": "userEvent.setup() call",
"description": "Calls userEvent.setup() to create a user instance before interactions (e.g. const user = userEvent.setup())",
"max_score": 12
},
{
"name": "No fireEvent usage",
"description": "Does NOT use fireEvent for any user interaction (click, type, change, etc.)",
"max_score": 12
},
{
"name": "Async user actions",
"description": "All userEvent actions (user.click, user.type, etc.) are awaited with async/await",
"max_score": 10
},
{
"name": "getByRole or getByLabelText for inputs",
"description": "Finds form fields using getByLabelText or getByRole rather than getByTestId, querySelector, or wrapper.find",
"max_score": 12
},
{
"name": "getByRole for buttons",
"description": "Finds buttons using getByRole('button', ...) rather than getByTestId, querySelector, or wrapper.find",
"max_score": 10
},
{
"name": "No CSS selectors",
"description": "Does NOT use container.querySelector or similar CSS selector queries to find elements",
"max_score": 8
},
{
"name": "No implementation detail assertions",
"description": "Does NOT assert on component state, props, or internal class names — only tests what the user would see or interact with",
"max_score": 10
},
{
"name": "render and screen imports",
"description": "Imports render and screen from '@testing-library/react'",
"max_score": 8
},
{
"name": "jest-dom matchers",
"description": "Uses jest-dom matchers such as toBeInTheDocument() or toHaveValue() in assertions",
"max_score": 10
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
skills
testing-library-patterns
verifiers