Skip to content

Add accessibility and functional tests for topic pages #583

@mattobee

Description

@mattobee

Summary

Add test coverage for the new topic pages, following the project's two-layer accessibility testing strategy (axe-core scans + Playwright assertions).

Tests to add

Accessibility tests (tests/accessibility.spec.ts)

  1. /topics listing page — axe-core scan (WCAG 2.2 AA)
  2. /topics/{slug} detail page — axe-core scan (WCAG 2.2 AA)
  3. Heading hierarchy — verify <h1> exists on both pages, heading levels don't skip
  4. Navigation — verify aria-current="page" is set on the Topics nav link when on topic pages
  5. Landmark structure — verify topic page sections use appropriate landmarks

Functional tests

  1. Topics listing — verify topic names, descriptions, and links render correctly
  2. Topic detail page — verify topic name, body content, and event sections render
  3. Event sections — verify upcoming and past event sections appear with correct headings
  4. Cross-linking — verify topic links on event detail pages navigate to the correct topic page
  5. 404 handling — verify non-existent topic slug redirects to 404

Testing data

Use the "Repetitive Strain Injury" topic in the test dataset. Additional test topics may need to be created in the test dataset to cover edge cases (e.g. topic with no associated events).

Dependencies

Part of

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Not Started

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions