agentleFS
NVIDIAKnown publisherNVIDIA/elements/.agents/skills/authoring-tests/SKILL.md

authoring-tests

Skill115 starsChanged 55 days agoApache-2.0View on GitHub

Write and run automated tests for Elements components including unit, accessibility, visual, SSR, and lighthouse tests. Use this skill whenever the user wants to write, create, update, or debug test files (.test.ts, .test.axe.ts, .test.visual.ts, .test.ssr.ts, .test.lighthouse.ts). Also trigger when the user asks about createFixture, removeFixture, elementIsStable, emulateClick, untilEvent, runAxe, visual baselines, theme testing, or test structure patterns like describe block naming.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the specific guideline based on the test type you're working with:

    line 20
  2. Very specific:

    Unit Tests (.test.ts): Read testing-unit.md - covers createFixture, elementIsStable, event testing

    line 22
  3. Very specific:

    Accessibility Tests (.test.axe.ts): Read testing-accessibility.md - covers axe-core usage, WCAG compliance

    line 23
  4. Very specific:

    Visual Tests (.test.visual.ts): Read testing-visual.md - covers Playwright screenshots, theme testing

    line 24
  5. Very specific:

    SSR Tests (.test.ssr.ts): Read testing-ssr.md - covers server-side rendering compatibility

    line 25
  6. Very specific:

    Lighthouse Tests (.test.lighthouse.ts): Read testing-lighthouse.md - covers performance, accessibility scores

    line 26
  7. Very specific:

    Wait for Stability: Always use elementIsStable() before making assertions on Lit components

    line 31
  8. Distinctive:

    Comprehensive Coverage: All new components require unit, accessibility, and visual tests at minimum

    line 32
  9. Very specific:

    Real User Events: Use emulateClick and untilEvent for realistic event testing

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Authoring Tests

You MUST review @projects/site/src/docs/internal/guidelines/testing.md before making any testing changes.

When to Use This Skill

  • Creating new test files for components (.test.ts, .test.axe.ts, .test.visual.ts, .test.ssr.ts, .test.lighthouse.ts)
  • Debugging test failures or updating existing tests
  • Understanding testing utilities from @internals/testing
  • Setting up test configurations or HTML templates
  • Writing tests that follow project patterns

Test Type Guidelines

Read the specific guideline based on the test type you're working with:

  • Unit Tests (.test.ts): Read testing-unit.md - covers createFixture, elementIsStable, event testing
  • Accessibility Tests (.test.axe.ts): Read testing-accessibility.md - covers axe-core usage, WCAG compliance
  • Visual Tests (.test.visual.ts): Read testing-visual.md - covers Playwright screenshots, theme testing
  • SSR Tests (.test.ssr.ts): Read testing-ssr.md - covers server-side rendering compatibility
  • Lighthouse Tests (.test.lighthouse.ts): Read testing-lighthouse.md - covers performance, accessibility scores

Key Principles

  1. Test Isolation: Each test should be independent with proper setup/teardown using createFixture and removeFixture
  2. Wait for Stability: Always use elementIsStable() before making assertions on Lit components
  3. Comprehensive Coverage: All new components require unit, accessibility, and visual tests at minimum
  4. Real User Events: Use emulateClick and untilEvent for realistic event testing
  5. Theme Testing: Visual tests should cover both light and dark themes

References

  • Testing Overview
  • Unit Testing
  • Accessibility Testing
  • Lighthouse Testing
  • SSR Testing
  • Visual Testing
  • Vite Internals

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.