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

{
  "context": "Tests whether the agent uses within() to scope queries when the page contains duplicate link names across navigation and footer sections, and when querying specific table rows for their action buttons. Also checks that accessible role-based queries are used throughout.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "within() import",
      "description": "Imports within from '@testing-library/react'",
      "max_score": 8
    },
    {
      "name": "within() on nav",
      "description": "Uses within(navElement) to scope at least one link query to the navigation section rather than using a screen-level query",
      "max_score": 14
    },
    {
      "name": "within() on footer",
      "description": "Uses within(footerElement) to scope at least one link query to the footer section rather than using a screen-level query",
      "max_score": 14
    },
    {
      "name": "within() on table row",
      "description": "Uses within(rowElement) to scope queries to a specific table row when finding action buttons",
      "max_score": 12
    },
    {
      "name": "No ambiguous screen queries for duplicates",
      "description": "Does NOT use screen.getByRole('link', ...) or screen.getByText(...) directly for 'Home', 'About', 'Pricing', or 'Contact' links without within() scoping",
      "max_score": 10
    },
    {
      "name": "getByRole for navigation container",
      "description": "Uses getByRole('navigation', ...) to find the nav or footer container before scoping with within()",
      "max_score": 8
    },
    {
      "name": "getByRole for links",
      "description": "Uses getByRole('link', ...) inside within() calls to find individual links",
      "max_score": 8
    },
    {
      "name": "getByRole for buttons",
      "description": "Uses getByRole('button', ...) inside within() calls to find Edit and Delete buttons in a specific row",
      "max_score": 8
    },
    {
      "name": "Regex name matchers",
      "description": "At least two queries use a regex (e.g. /home/i) for the name option rather than an exact string",
      "max_score": 8
    },
    {
      "name": "No querySelector usage",
      "description": "Does NOT use container.querySelector or document.querySelector anywhere in the test file",
      "max_score": 10
    }
  ]
}

evals

tile.json