CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/testing-library-patterns

Testing Library patterns for React component testing — queries, user events,

99

1.03x
Quality

99%

Does it follow best practices?

Impact

100%

1.03x

Average score across 8 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsonevals/scenario-8/

{
  "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

tile.json