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

{
  "context": "Tests whether the agent uses the correct query priority (getByRole > getByLabelText) for different element types and consistently uses case-insensitive regex matchers rather than exact strings for text options. Also checks avoidance of brittle selectors.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "getByLabelText for text input",
      "description": "Uses getByLabelText (or getByRole('textbox', ...)) to find the keyword text input, not getByTestId or querySelector",
      "max_score": 10
    },
    {
      "name": "getByRole for checkboxes",
      "description": "Uses getByRole('checkbox', { name: ... }) to find at least one category checkbox",
      "max_score": 10
    },
    {
      "name": "getByRole for combobox/select",
      "description": "Uses getByRole('combobox', ...) or getByLabelText(...) to find the employment type dropdown, not querySelector or getByTestId",
      "max_score": 10
    },
    {
      "name": "getByRole for submit button",
      "description": "Uses getByRole('button', { name: ... }) to find the search/submit button, not getByText with exact string or querySelector",
      "max_score": 10
    },
    {
      "name": "Regex for input name",
      "description": "The query for the keyword input uses a regex (e.g. /keywords/i) rather than an exact string",
      "max_score": 8
    },
    {
      "name": "Regex for checkbox name",
      "description": "The query for at least one checkbox uses a regex (e.g. /engineering/i) rather than an exact string",
      "max_score": 8
    },
    {
      "name": "Regex for button name",
      "description": "The query for the submit button uses a regex (e.g. /search/i) rather than an exact string",
      "max_score": 8
    },
    {
      "name": "No getByTestId usage",
      "description": "Does NOT use getByTestId to find any of the form elements",
      "max_score": 8
    },
    {
      "name": "No querySelector usage",
      "description": "Does NOT use container.querySelector or document.querySelector anywhere in the test file",
      "max_score": 8
    },
    {
      "name": "userEvent.setup() before render",
      "description": "Calls userEvent.setup() before render() in each test that uses user interactions",
      "max_score": 8
    },
    {
      "name": "Awaited user actions",
      "description": "All userEvent actions (user.type, user.click, user.selectOptions, etc.) are awaited",
      "max_score": 6
    },
    {
      "name": "No fireEvent usage",
      "description": "Does NOT use fireEvent for any interaction in the test file",
      "max_score": 6
    }
  ]
}

evals

tile.json