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

[ButtonBase] Change tests to use faketimers #6559

Merged

Conversation

agamrafaeli
Copy link
Contributor

@agamrafaeli agamrafaeli commented Apr 9, 2017

Testing of keyboard focus on button base relied on a certain time gap.
This commit changes the test for this case to use sinon's fake timers

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).

Testing of keyboard focus on button base relied on a certain time gap.
This commit changes the test for this case to use sinon's fake timers
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Almost good to me 👍

done();
}, 200);
after(() => {
clock.restore();
Copy link
Member

Choose a reason for hiding this comment

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

I would rather have the after block at the top, right under the before bloc. It's our convention. Plus the setup and teardown phases are deeply linked.

@oliviertassinari oliviertassinari added next test PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: Needs Review labels Apr 9, 2017
@agamrafaeli
Copy link
Contributor Author

@oliviertassinari made the relevant changes

@oliviertassinari oliviertassinari added PR: Review Accepted and removed PR: Needs Review PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI labels Apr 10, 2017
@oliviertassinari oliviertassinari merged commit 14b5829 into mui:next Apr 10, 2017
@oliviertassinari
Copy link
Member

@agamrafaeli Thanks 😄 .

@agamrafaeli agamrafaeli deleted the buttonbase-change-test-to-timers branch April 23, 2017 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants