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-1/

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

criteria.json

task.md

tile.json