sentry icon indicating copy to clipboard operation
sentry copied to clipboard

fix(ui): Add missing 'return' statement in <SourceMapsDebuggerModal />

Open floels opened this issue 1 year ago • 3 comments

Goal

The goal of this PR is to add a missing early return statement in static/app/components/ events/interfaces/sourceMapsDebuggerModal.tsx.

Approach

We add the missing return statement in the component's file, and also add a test file (sourceMapsDebuggerModal.spec.tsx) and a first test to cover this behavior of the component.

You can see that this test fails if you remove the fix in sourceMapsDebuggerModal.tsx.

According to Istanbul, this increases the statement coverage of the sourceMapsDebuggerModal.tsx file from 13%:

Screenshot 2024-05-09 at 15 15 51

to 39%:

Screenshot 2024-05-09 at 15 20 08

which shows we need to add more test cases to this test file.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

floels avatar May 09 '24 13:05 floels

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.89%. Comparing base (276d1d5) to head (2b9902d). Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #70573      +/-   ##
==========================================
+ Coverage   77.87%   77.89%   +0.01%     
==========================================
  Files        6528     6528              
  Lines      290889   290889              
  Branches    50336    50336              
==========================================
+ Hits       226544   226578      +34     
+ Misses      58105    58088      -17     
+ Partials     6240     6223      -17     
Files Coverage Δ
...ents/events/interfaces/sourceMapsDebuggerModal.tsx 33.93% <100.00%> (+22.42%) :arrow_up:

... and 74 files with indirect coverage changes

codecov[bot] avatar May 09 '24 13:05 codecov[bot]

Nice thanks!

lforst avatar May 14 '24 11:05 lforst

Thanks! I think there are some checks that I need to be able to merge and that I cannot trigger myself as an external contributor. @lforst is that correct? If so, could you trigger them on your end? 🙏

floels avatar May 18 '24 11:05 floels

Sorry, I was at react conf last week so this kinda slipped. I'll make sure this gets merged. Thanks for the bump!

lforst avatar May 21 '24 08:05 lforst

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ Error: useLocation() may be used only in the context of a <Router> component. useLocation(useLocation.tsx) View Issue

Did you find this useful? React with a 👍 or 👎

sentry[bot] avatar May 22 '24 23:05 sentry[bot]