-
Notifications
You must be signed in to change notification settings - Fork 782
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
Core: adds back running class to items and adds tests #1323
Core: adds back running class to items and adds tests #1323
Conversation
1823961
to
79461de
Compare
test/reporter-html-running-class.js
Outdated
@@ -0,0 +1,5 @@ | |||
QUnit.module( "Ensure that html reporter adds running class", 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.
Thanks for adding a test! This, however, should probably go in the existing reporter-html
test file: https://github.com/qunitjs/qunit/blob/master/test/reporter-html/reporter-html.js
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.
@trentmwillis good idea, just added the test there
79461de
to
01a81ca
Compare
01a81ca
to
fa1856e
Compare
Thank you! |
== Background In QUnit 1.16.0, as part of #677, commit 168b048 changed the testStart() callback to no longer always create `qunit-test-output-TESTID` with class "running", but instead eagerly create them ahead of time via a QUnit.begin() handler (without the "running" class), and then during testStart() set the class to "running", or lazily create the item then. This introduced a bug where, late-defined tests lack the "running" class. This bug then later spread to all items as we now treat all tests as late-defined. In QUnit 2.8.0, as part of #1323, this was attempted to be restored, but it added it to a different element, namely `#qunit-testresult-display` which from what I could find in our history, never previously carried this class. This might've been done by acciddent, but in any case, let's keep that. == What * Restore this to simplify the CSS, and makes it more developer-friendly to theme QUnit by not having to list all statuses, and/or having to use a direct-child selector like `#qunit-tests > li` to reliably select test items (and not other lists like the assertion list). * For back-compat, keep the running class on `qunit-testresult-display` but move it to onBegin() since there is no reason to set this again and again on every test since it never changes. * Document these bits in the recently created "Theme API" section.
== Background In QUnit 1.16.0, as part of #677, commit 168b048 changed the testStart() callback to no longer always create `qunit-test-output-TESTID` with class "running", but instead eagerly create them ahead of time via a QUnit.begin() handler (without the "running" class), and then during testStart() set the class to "running", or lazily create the item then. This introduced a bug where, late-defined tests lack the "running" class. This bug then later spread to all items as we now treat all tests as late-defined. In QUnit 2.8.0, as part of #1323, this was attempted to be restored, but it added it to a different element, namely `#qunit-testresult-display` which from what I could find in our history, never previously carried this class. This might've been done by acciddent, but in any case, let's keep that. == What * Restore this to simplify the CSS, and makes it more developer-friendly to theme QUnit by not having to list all statuses, and/or having to use a direct-child selector like `#qunit-tests > li` to reliably select test items (and not other lists like the assertion list). * For back-compat, keep the running class on `qunit-testresult-display` but move it to onBegin() since there is no reason to set this again and again on every test since it never changes. * Document these bits in the recently created "Theme API" section.
the running class was removed and no existing tests catch this, I added it back and now added with it a test to ensure this doesn't happen again.