All topics

Testing

data-test-component and data-test-id conventions for stable automation selectors.

Testing

Three categories worth testing, two attributes for automation, and AI guardrails to catch breakage early.

  1. 01

    Test what matters

    • Business logic · behaviour logic · component behaviour
    • Not styling, not implementation, not snapshot diffs
    • If it doesn't fit, you're testing the wrong thing
  2. 02

    Two attributes, two purposes

    • data-test-component — reusable elements, can repeat
    • data-test-id — specific instance, unique per page
    • Apply to new code, migrate legacy over time
  3. 03

    Selectors with context

    • "video" tells you nothing — which one, where?
    • Include enough context to find it without the file
    • No more snowflake selectors
  4. 04

    AI guardrails

    • Rules flag changes that would break automation
    • Caught at PR review, not an hour into the test run
    • Still improving — already cutting the "I broke the suite" cycle

Test what matters, identify things consistently, and let tooling catch the rest — fewer flaky tests, more real signal.