fix(#943): wrap Statistics in ErrorBoundary with retry fallback#1067
Merged
hman38705 merged 1 commit intoJun 30, 2026
Merged
Conversation
…fallback - Add retry button to the ErrorBoundary fallback in LandingPage.tsx wrapping Statistics, using the existing .retry-button CSS class and aria-label 'Retry loading statistics' for accessibility - Add ErrorBoundary import to Statistics.test.tsx - Add 'Statistics wrapped in ErrorBoundary' describe block with three tests: - catches a rendering exception and renders the fallback - renders a retry button in the fallback when Statistics throws - does not render Statistics content when an error is thrown - Update LandingPage.error-boundary.test.tsx to assert the retry button is present in the fallback Closes solutions-plug#943
|
@Coredevjay 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.
Summary
Closes #943.
The
Statisticscomponent had no error isolation — any unhandled rendering exception propagated straight to the page root, causing a full blank-screen crash. This PR wires up the existingErrorBoundaryaroundStatisticsinLandingPageand improves the fallback UI with a retry affordance.Changes
frontend/src/components/LandingPage.tsxErrorBoundarywrapper that already existed around<Statistics />had a fallback<section>with no way for the user to recover.aria-label="Retry loading statistics") inside that fallback, using the pre-existing.retry-buttonCSS class fromStatistics.css.window.location.reload(), giving users a clear escape route when the component crashes rather than staring at a static error message.frontend/src/components/__tests__/Statistics.test.tsxErrorBoundaryfrom../ErrorBoundary.describe('Statistics wrapped in ErrorBoundary')block with three focused unit tests:<ErrorBoundary><ThrowingStatistics /></ErrorBoundary>and asserts the fallback heading, alert role, and message are rendered.getByRole('button', { name: /retry loading statistics/i })is in the fallback.ThrowingStatisticshelper component that unconditionally throws to simulate a runtime rendering exception.console.erroris suppressed per test to keep output clean; restored viaafterEach.frontend/src/components/__tests__/LandingPage.error-boundary.test.tsx'should render error fallback when Statistics throws'test to also assert that the retry button is rendered, keeping the integration test in sync with the new fallback UI.Acceptance Criteria
Statisticswrapped inErrorBoundaryfromsrc/components/ErrorBoundary.tsxLandingPage.tsx; this PR adds the missing retry affordanceStatistics.test.tsxTesting
No new dependencies. Tests are in Jest + React Testing Library (already set up in the project).