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

Core: adds back running class to items and adds tests #1323

Merged

Conversation

gabrielcsapo
Copy link
Contributor

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.

@@ -0,0 +1,5 @@
QUnit.module( "Ensure that html reporter adds running class", function() {
Copy link
Member

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

Copy link
Contributor Author

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

@trentmwillis
Copy link
Member

Thank you!

@trentmwillis trentmwillis merged commit 7910456 into qunitjs:master Nov 1, 2018
Krinkle added a commit that referenced this pull request Jul 14, 2024
== 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.
Krinkle added a commit that referenced this pull request Jul 14, 2024
== 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.
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.

None yet

2 participants