Add tests for the empty state key value grid and pag heading layout primitives#186
Merged
Conversation
Contributor
|
well done — in it goes 🚀 |
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 #79
Add Test Coverage for EmptyState, KeyValueGrid, and PageHeading
Summary
This PR adds comprehensive test coverage for three shared presentational components:
EmptyStateKeyValueGridPageHeadingThese components are widely reused across list and detail pages but previously had no dedicated tests. The new test suite validates their rendering contracts, semantic structure, and optional prop behavior to prevent regressions.
Problem
The layout primitives currently lack test coverage, making it possible for changes to unintentionally break:
Because these components are reused throughout the application, regressions could affect multiple pages without being detected.
Changes
EmptyState
Added tests to verify:
KeyValueGrid
Added tests to verify:
<dt>/<dd>pairPageHeading
Added tests to verify:
<h1>Documentation
Testing Approach
Tests use semantic queries such as:
getByRolegetByTextqueryByTextrather than implementation-specific class assertions.
This keeps tests resilient while validating actual user-visible behavior.
Accessibility and Semantics
Validated:
<h1>rendering for page headings<dl>,<dt>, and<dd>structure for key-value contentEdge Cases Covered
Validation
Executed:
npm run lint npm run typecheck npm testAcceptance Criteria