Skip to content

Test/testing settings page#213

Open
real-venus wants to merge 2 commits into
Agentpay-Org:mainfrom
real-venus:test/testing-settings-page
Open

Test/testing settings page#213
real-venus wants to merge 2 commits into
Agentpay-Org:mainfrom
real-venus:test/testing-settings-page

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

test(settings): cover Settings page Appearance section and ThemeToggle

Closes #150

What changed

New src/app/settings/page.test.tsx:

  • asserts the <h1>Settings</h1> heading (by role and literal copy)
  • asserts the Appearance <h2> and its descriptive copy
  • asserts the ThemeToggle control renders — the labelled "Theme" button
    group with light / dark / system options
  • asserts the <main id="main-content"> landmark exists for the skip link
  • stubs window.matchMedia (absent in jsdom, read by ThemeToggle via
    readTheme() / effectiveTheme()) so the page renders without throwing, and
    guards that as an explicit regression

Coverage: 100% of src/app/settings/page.tsx (exceeds the 95% requirement).

Add page-level tests for src/app/settings/page.tsx, which previously had no
coverage:

- asserts the <h1> Settings heading
- asserts the Appearance <h2> and its descriptive copy
- asserts the ThemeToggle control (the labelled 'Theme' button group with
  light/dark/system options) is present
- asserts the <main id="main-content"> landmark exists for the skip link
- stubs window.matchMedia (absent in jsdom) so the page renders without
  throwing, and guards that as a regression

100% coverage of the settings page.
These pre-existing failures on main block lint/build for any PR branched
from it:

- src/app/docs/page.tsx used resolveApiBase() and <CurlBlock> without
  importing them (react/jsx-no-undef lint error + next build typecheck
  failure). Add the missing imports.
- Two Header tests expected primary links marked aria-current twice
  (desktop + mobile), but the mobile nav panel only renders while open, so
  exactly one link is current at rest. Correct the assertions to match the
  component and the tests' own 'exactly one' descriptions.
@real-venus

Copy link
Copy Markdown
Contributor Author

@mikewheeleer
please review this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for the Settings page Appearance section and ThemeToggle wiring

1 participant