HTML Reporter: Fix reversed order after clicking "Hide passed" #1763
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.
Follows-up #1311.
This fixes a regression in QUnit 2.7.0. When viewing a finished test run and turning on "Hide passed" and then turning it off again, the second click, reverses the result order.
This was because we hide each test from top to bottom (and push into the array), but then upon re-inserting them we used
pop()
, which means we first append the last test to the end of the page, and then the before-last is popped after that and appended to what is now the end of the page, etc. The end result is the tests originally display from A-Z, and are stored in the array from A-Z as well, but then after toggling on/off, get rendered Z-A.