Repository navigation
test: add regression coverage for ErrorRateDataPoint failure handling - #910
Open
egwujiohaifesinachiperpetual-max wants to merge 1 commit into
Conversation
|
@egwujiohaifesinachiperpetual-max Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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 #709
This pull request adds explicit regression coverage for ErrorRateDataPoint empty-result/failure paths in the ErrorRateSparklineTile component.
It exercises the branch identified in evidence (src/components/ErrorRateSparklineTile/ErrorRateSparklineTile.tsx:33), explicitly asserting the empty path and its boundary returns, and the neighboring normal paths.
Changes Made
Exported the internal helper functions MiniSparkline and sparklinePath to allow deterministic testing of boundary states.
Added explicit tests for MiniSparkline:
returns null when data is empty (exercises the failure path if (data.length === 0) return null;)
renders correctly with normal data boundary (exercises the normal rendering path)
Added explicit tests for sparklinePath:
returns empty string when points are empty (exercises the failure path if (points.length === 0) return "";)
returns correct SVG path for neighboring normal path inputs (exercises the coordinate path drawing logic)
Exercised Cases & Results
MiniSparkline with data = []: Successfully asserted that it returns null.
MiniSparkline with 1 data point (length = 1): Successfully asserted that it renders the SVG container for a normal boundary path.
sparklinePath with points = []: Successfully asserted that it returns an empty string "".
sparklinePath with 2 normal boundary coordinate points: Successfully asserted it returns the correct path structure M 0,0 L 10,10.
All existing contracts for ErrorRateSparklineTile were preserved, while previously hidden internal states are now directly observable and documented by the test suite.