Conversation
I'd like to add a unit test here, but struggled with it |
Codecov Report
@@ Coverage Diff @@
## next #3434 +/- ##
=========================================
+ Coverage 49.8% 49.82% +0.02%
=========================================
Files 109 109
Lines 4516 4516
Branches 930 930
=========================================
+ Hits 2249 2250 +1
+ Misses 2267 2266 -1
Continue to review full report at Codecov.
|
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.
Looks good! wrote a comment to make sure I understand the fix. For the test, i would propose something like this:
describe("truncateFrames") {
it("will truncate frames with FrameworkGrouping off") {
const frameworkGroupingOn = false;
const framesWithFramework = [ ... ] // datastructure
const framesWithoutFramework = [ ... ] // datastructure
const frames = [ ...framesWithFramework, ...framesWithoutFramework ];
const { component } = render({ frameworkGroupingOn, frames });
const button = component.find('button') // or whatever selector for that button
button.simulate('click');
expect(component.find('Frame').length).toBe(frames.length); // uncollapse
button.simulate('click')
expect(component.find('Frame').length).toBe(framesWithoutFramework.length + 1); // collapse
})
its a bit pseudocody... haven't tried it yet
I also tested this locally with this branch and the next branch. In the original issue it says that frames are missing, which ones should I look for?
@@ -154,7 +154,7 @@ class Frames extends Component { | |||
? L10N.getStr("callStack.collapse") | |||
: L10N.getStr("callStack.expand"); | |||
|
|||
frames = collapseFrames(frames); | |||
frames = this.collapseFrames(frames); |
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.
Was the issue that if frameworkGroupingOn was not checked, collapse frame would be run with unexpected results?
Associated Issue: #
Summary of Changes