Web component testing

From rogie/figui3 · View interactive version

Web component testing is an AI agent skill from the GitHub repository rogie/figui3. Guides real-browser tests for FigUI3 custom elements. Use when adding or debugging tests for fig-* web components, attribute/property contracts, value synchronization, event payloads, disabled behavior, or custom element registration.

How to use this skill

Skill file

Web Component Testing

Use Playwright in a real browser for fig-* components. Avoid jsdom for component behavior because this repo depends on Custom Elements, layout, focus, dialogs, pointer events, media elements, and CSS.

Contract Priorities

  1. Assert registration with customElements.get(tag) or customized built-in upgrade.
  2. Mount representative markup and wait for customElements.whenDefined(tag).
  3. Fail on page errors and unexpected console errors.
  4. Test both attribute writes and property writes for value-like APIs.
  5. Capture input, change, and component-specific events from real interactions.
  6. Assert event.detail shape for data controls.
  7. Verify disabled controls do not emit normal interaction changes where applicable.

Interaction Pattern

Fixture Guidance

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.