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

refactor: onload listener for stylesheets in before hook of tests #1132

Merged
merged 12 commits into from
Nov 1, 2018

Conversation

jeeyyy
Copy link
Contributor

@jeeyyy jeeyyy commented Sep 12, 2018

This PR refactors the addStyleSheet helper for CSSOM based tests into axe.testUtils object. The function also returns a promise, thereby allowing to wait until the stylesheets are loaded in the before hook, thus ensuring assets are available before running respective tests.

Closes issue:

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version (MS: needs squashing)
  • Has documentation updated, a DU ticket, or requires no documentation change
  • Includes new tests, or was unnecessary
  • Code is reviewed for security by: << Marcy Sutton >>

@jeeyyy jeeyyy requested a review from a team as a code owner September 12, 2018 05:17
@jeeyyy jeeyyy changed the title refactor: onload listener for stylesheets in before hook of tests Refactor: onload listener for stylesheets in before hook of tests Sep 12, 2018
@jeeyyy jeeyyy self-assigned this Sep 21, 2018
})
.catch(function(error) {
console.error('Could not load stylesheets for testing.', error);
done();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should cause the tests to fail.

})
.catch(function(error) {
console.error('Could not load stylesheets for testing.', error);
done();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, if injecting fails, the before hook should fail.

promises.push(p);
});

return Promise.all(promises);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work in IE.

@jeeyyy jeeyyy changed the title Refactor: onload listener for stylesheets in before hook of tests test: onload listener for stylesheets in before hook of tests Oct 29, 2018
@jeeyyy jeeyyy changed the title test: onload listener for stylesheets in before hook of tests refactor: onload listener for stylesheets in before hook of tests Oct 29, 2018
@jeeyyy
Copy link
Contributor Author

jeeyyy commented Oct 29, 2018

@WilcoFiers

Usage of Promise has been removed in these test updated. Please review again.

@jeeyyy jeeyyy requested review from a team and stephenmathieson October 29, 2018 16:37
@jeeyyy jeeyyy merged commit a9e0dff into develop Nov 1, 2018
@jeeyyy jeeyyy deleted the load-sheets-listener branch November 1, 2018 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants