Skip to content

HTML Reporter: Fix reversed order after clicking "Hide passed"#1763

Merged
Krinkle merged 1 commit intomainfrom
eqeqeq
Jun 12, 2024
Merged

HTML Reporter: Fix reversed order after clicking "Hide passed"#1763
Krinkle merged 1 commit intomainfrom
eqeqeq

Conversation

@Krinkle
Copy link
Copy Markdown
Member

@Krinkle Krinkle commented Jun 12, 2024

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.

Follows-up #1311.

Since QUnit 2.7.0, when viewing a finished test run and turning on
"Hide passed" and then turning it off again, resulted in the same
results being shown again, but in reversed order.

This was because we hide the tests 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, but 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 first displaying from
A-Z, then after toggling on/off, displaying from Z-A.
@Krinkle Krinkle merged commit 12b4cdb into main Jun 12, 2024
@Krinkle Krinkle deleted the eqeqeq branch June 12, 2024 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant