Enterprise-CMCS / eAPD

CMS (Centers for Medicare and Medicaid Services) eAPD - Modernizing the APD experience
https://eapd.cms.gov
Other
58 stars 25 forks source link

4540 [Feature] Trap errors on the react side to avoid the white screen of death #4680

Closed Sun-Mountain closed 1 year ago

Sun-Mountain commented 1 year ago

Resolves #4540

Description

When issues are thrown on the frontend, they currently cause a white screen of death and you have to do a hard refresh or remove parts of the URL to navigate back to a viewable page. If an error is thrown on the frontend the user is taken to an error page and they can navigate to a safe page from there.

Chromatic Link

https://www.chromatic.com/build?appId=61d5b948cf6f17003a12bf77&number=1498

Automated test cases written

Given When Then Type (jest, tap, cypress)
An error is thrown by incomplete code should throw an error page where it's easier to go to another page jest

Steps to manually verify this change

  1. Go to a page, delete some code or put in bad code to case the page to not load
  2. Confirm the below shows up instead of a blank screen.
Screenshot 2023-04-17 at 3 12 55 PM

This pull request is ready to code review when

This pull request is ready to test when

This pull request is ready to review when QA has

This pull request can be merged when

codecov[bot] commented 1 year ago

Codecov Report

Merging #4680 (1ba030e) into main (a2489f4) will increase coverage by 0.08%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4680      +/-   ##
==========================================
+ Coverage   91.68%   91.77%   +0.08%     
==========================================
  Files         286      287       +1     
  Lines        9288     9301      +13     
  Branches     1894     1895       +1     
==========================================
+ Hits         8516     8536      +20     
+ Misses        743      736       -7     
  Partials       29       29              
Flag Coverage Δ
api ∅ <ø> (∅)
common 98.75% <ø> (ø)
web 91.39% <100.00%> (+0.09%) :arrow_up:
Impacted Files Coverage Δ
web/src/pages/MainRoutes.js 100.00% <ø> (ø)
web/src/components/ErrorBoundary.js 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a2489f4...1ba030e. Read the comment docs.

cms-eapd-bot commented 1 year ago

This deploy was cleaned up.