Skip to content

test: cover docs page endpoint sections and openapi link#183

Open
shinzoxD wants to merge 1 commit into
StableRoute-Org:mainfrom
shinzoxD:test/docs-29-page-coverage
Open

test: cover docs page endpoint sections and openapi link#183
shinzoxD wants to merge 1 commit into
StableRoute-Org:mainfrom
shinzoxD:test/docs-29-page-coverage

Conversation

@shinzoxD

@shinzoxD shinzoxD commented Jul 8, 2026

Copy link
Copy Markdown

Closes #113

Summary

Adds comprehensive test coverage for the docs page:

  • 6 tests covering:
    • Page heading renders
    • #main-content focus target present with correct tabIndex
    • OpenAPI link points to /api/v1/openapi.json
    • All 5 endpoint sections render as <dt>/ <dd> pairs
    • Rendered term/definition count matches the sections array length

Verification

  • npm test -- --coverage: 6/6 passed
  • npm run lint: No ESLint warnings or errors
  • Page source untouched — test-only change

Copilot AI review requested due to automatic review settings July 8, 2026 11:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dedicated test suite for the Next.js docs page (/docs) to lock down core content and structure, reducing the risk of accidental regressions in API documentation rendering.

Changes:

  • Adds RTL/Jest tests for the docs page heading, #main-content focus target, and the OpenAPI link target.
  • Adds assertions that all documented endpoint sections render and that <dt>/<dd> counts match the expected number of sections.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +39 to +46
const term = screen.getByText(section.h);
expect(term).toBeInTheDocument();
expect(term.tagName).toBe("DT");

// Each description renders as a <dd> definition
const definition = screen.getByText(section.p);
expect(definition).toBeInTheDocument();
expect(definition.tagName).toBe("DD");
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 docs page endpoint sections and external openapi link

2 participants