test: cover docs page endpoint sections and openapi link#183
Open
shinzoxD wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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-contentfocus 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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #113
Summary
Adds comprehensive test coverage for the docs page:
#main-contentfocus target present with correcttabIndex/api/v1/openapi.json<dt>/<dd>pairssectionsarray lengthVerification
npm test -- --coverage: 6/6 passednpm run lint: No ESLint warnings or errors