e11y-tdd

Solid

Use when implementing Phoenix LiveView features - TDD with html_snapshot for state inspection and axe-core for accessibility. Sprinkle snapshots to see what's rendered, delete when done.

Testing & QA 42 stars 5 forks Updated 3 weeks ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
54
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Excessibility TDD - Build with Inspection Build Phoenix LiveView features with full visibility into rendered HTML and state. ## Core Powers - **`html_snapshot(view)`** - Capture HTML at any point (sprinkle liberally while building) - **axe-core checks** - Ensure accessibility (WCAG compliance) - **Timeline analysis** - See state evolution across events ## The e11y-TDD Cycle ``` 1. EXPLORE - Add html_snapshot(view) calls to see what's rendered 2. RED - Write test with snapshot at key moment 3. GREEN - Implement feature, use snapshots to debug 4. CHECK - Run `mix excessibility` for axe-core/a11y validation 5. CLEAN - Remove temporary snapshots, keep essential ones ``` ## Snapshot Strategies ### Temporary Snapshots (for building/debugging) Sprinkle these while building. Delete when feature works. ```elixir test "building new feature" do {:ok, view, _html} = live(conn, "/page") # Sprinkle these to see what's happening html_snapshot(view) # <- see initial state view |> element("button") |> render_click() html_snapshot(view) # <- see after click view |> form("#my-form") |> render_submit(%{name: "test"}) html_snapshot(view) # <- see after submit # Delete these when feature works end ``` ### Permanent Snapshots (for regression testing) Keep these - axe-core will check them on every run. ```elixir test "feature works and is accessible" do {:ok, view, _html} = live(conn, "/page") view |> element("button") |> render_click() ...

Details

Author
lessthanseventy
Repository
lessthanseventy/excessibility
Created
3 years ago
Last Updated
3 weeks ago
Language
Elixir
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category