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

{
  "context": "Tests whether the agent uses toBeVisible() rather than toBeInTheDocument() when asserting on elements that are toggled via CSS visibility, and correctly distinguishes between presence in the DOM and actual visibility to the user.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "toBeVisible() for visible dialog",
      "description": "Uses toBeVisible() (not toBeInTheDocument()) when asserting the modal dialog IS visible after the cancel button is clicked",
      "max_score": 15
    },
    {
      "name": "not.toBeVisible() for hidden dialog",
      "description": "Uses expect(...).not.toBeVisible() (not .not.toBeInTheDocument()) when asserting the modal is NOT visible in its initial or dismissed state",
      "max_score": 15
    },
    {
      "name": "toBeVisible() for tooltip",
      "description": "Uses toBeVisible() when asserting the tooltip IS visible after the info button is clicked",
      "max_score": 12
    },
    {
      "name": "not.toBeVisible() for hidden tooltip",
      "description": "Uses expect(...).not.toBeVisible() when asserting the tooltip is NOT visible before it is toggled on",
      "max_score": 12
    },
    {
      "name": "No toBeInTheDocument() for visibility checks",
      "description": "Does NOT use toBeInTheDocument() as the primary assertion for any element whose visibility is being tested (dialog or tooltip)",
      "max_score": 10
    },
    {
      "name": "getByRole for dialog",
      "description": "Uses getByRole('dialog', ...) to find the modal element",
      "max_score": 8
    },
    {
      "name": "getByRole for tooltip",
      "description": "Uses getByRole('tooltip') to find the tooltip element",
      "max_score": 8
    },
    {
      "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",
      "max_score": 6
    },
    {
      "name": "No fireEvent usage",
      "description": "Does NOT use fireEvent for any interactions in the test file",
      "max_score": 6
    }
  ]
}

evals

tile.json