-
Notifications
You must be signed in to change notification settings - Fork 407
Correct remaining flapping test coverage #1903
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1903 +/- ##
==========================================
+ Coverage 91.04% 91.55% +0.51%
==========================================
Files 185 185
Lines 10719 10707 -12
Branches 1575 1574 -1
==========================================
+ Hits 9759 9803 +44
+ Misses 960 904 -56
Continue to review full report at Codecov.
|
| componentDidUpdate(prevProps) { | ||
| if (this.props.editorHolder !== prevProps.editorHolder) { | ||
| this.editorSub.dispose(); | ||
| this.editorSub = this.state.editorHolder.observe(this.observeParents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you change from state to props because that's easier to test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it was actually just broken before 😅 We hadn't had any tests that covered an update of an existing component, and apparently it doesn't come up in our package yet. But editorHolder is a member of the state in the wrapper class that reads Context, not in the BareDecoration!
| const bundle = await this.git().getStatusBundle(); | ||
| const results = await this.formatChangedFiles(bundle); | ||
| results.branch = bundle.branch; | ||
| if (!results.branch.aheadBehind) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is unused, I take it? good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup! getStatusBundle will always return an empty aheadBehind with our versions of git and what-the-status.
| await assert.async.isTrue(refreshResolutionProgress.calledWith(fixtureFile)); | ||
| }); | ||
|
|
||
| it('performs a resolution from the context menu', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh cool - I did not know resolving from the context menu was a thing.
Please be sure to read the contributor's guide to the GitHub package before submitting any pull requests.
Requirements
Description of the Change
I'm adding unit tests to cover the remaining lines that I've seen flap in our CodeCov reports, either by adding tests for specific lines I've seen flap, or just explicitly covering entire files and were only covered incidentally before.
Specifically:
lib/models/conflicts/side.jslib/atom/decoration.jslib/controllers/editor-conflict-controller.jslib/models/repository-states/present.jsAlternate Designs
N/A
Benefits
More reliable and actionable CodeCov reports.
Possible Drawbacks
It's a fair amount of rote work to do. But my head is thoroughly stuffed today so this is a good way to deliver some value without requiring higher-order thinking skills.
Applicable Issues
Continuing the work begin in #1900 and #1901.
Metrics
The CodeCov master report is a good one to watch.
Tests
Ideally we'll see coverage ⬆️ in the CodeCov report comment for those files. (Note that there is a delay while the Windows tests roll in.)
Documentation
N/A
Release Notes
N/A
User Experience Research (Optional)
N/A