Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 12, 2024
Merged

Conversation

Krinkle
Copy link
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
21 checks passed
@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