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 uses queryBy* (not getBy*) when asserting element absence after dismissal, uses waitFor correctly (assertions only, no side effects inside waitFor), and properly handles state-update assertions after user interactions.",
"type": "weighted_checklist",
"checklist": [
{
"name": "queryBy* for dismissed notification",
"description": "Uses queryByText or queryByRole (not getByText or getByRole) when asserting that a dismissed notification is NO LONGER in the document",
"max_score": 15
},
{
"name": "not.toBeInTheDocument() after dismiss",
"description": "Uses expect(screen.queryBy*(...)).not.toBeInTheDocument() to verify a dismissed notification is gone",
"max_score": 12
},
{
"name": "queryBy* for empty state check",
"description": "Does NOT use getBy* when asserting that a list item or notification is absent — uses queryBy* consistently for all absence assertions",
"max_score": 10
},
{
"name": "No getBy* for absence",
"description": "Does NOT use getByText(...) or getByRole(...) in a .not.toBeInTheDocument() or similar negative assertion anywhere in the test file",
"max_score": 12
},
{
"name": "waitFor assertions only",
"description": "Any waitFor() call contains only assertions (expect statements), NOT side effects like user.click() or user.type()",
"max_score": 12
},
{
"name": "userEvent.setup() before render",
"description": "Calls userEvent.setup() before render() in tests that involve user interactions",
"max_score": 8
},
{
"name": "Awaited user actions",
"description": "All userEvent actions (user.click, etc.) are awaited with async/await",
"max_score": 8
},
{
"name": "getByRole for buttons",
"description": "Uses getByRole('button', { name: ... }) to find dismiss or clear-all buttons rather than querySelector or getByTestId",
"max_score": 8
},
{
"name": "Regex for query names",
"description": "At least one query uses a regex (e.g. /clear all/i or /dismiss/i) for the name option",
"max_score": 8
},
{
"name": "No querySelector usage",
"description": "Does NOT use container.querySelector or document.querySelector anywhere in the test file",
"max_score": 7
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
skills
testing-library-patterns
verifiers