Skip to content

test: add regression coverage for ErrorRateDataPoint failure handling - #910

Open
egwujiohaifesinachiperpetual-max wants to merge 1 commit into
RevoraOrg:masterfrom
egwujiohaifesinachiperpetual-max:fix-error-rate-tests
Open

egwujiohaifesinachiperpetual-max wants to merge 1 commit into
RevoraOrg:masterfrom
egwujiohaifesinachiperpetual-max:fix-error-rate-tests

Conversation

@egwujiohaifesinachiperpetual-max

Copy link
Copy Markdown

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.

@drips-wave

drips-wave Bot commented Sep 30, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

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 regression coverage for ErrorRateDataPoint failure handling

1 participant