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

test: update animation click test #1053

Merged
merged 3 commits into from
Feb 18, 2020
Merged

test: update animation click test #1053

merged 3 commits into from
Feb 18, 2020

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Feb 18, 2020

No description provided.

@JoelEinbinder
Copy link
Contributor

What is this change doing? The test is still disabled?

@dgozman
Copy link
Contributor Author

dgozman commented Feb 18, 2020

What is this change doing? The test is still disabled?

Yep. The test was flaky by itself, so I updated it in the hopes we can now pass it, but that revealed two issues (see the comment).

@JoelEinbinder
Copy link
Contributor

JoelEinbinder commented Feb 18, 2020

Whats the plan to pass this test?

const animateLeft = () => {
const button = document.querySelector('button');
button.style.left = window.atLeft ? '${containerWidth - buttonSize}px' : '0px';
console.log('set ' + button.style.left);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: unneeded console log

test/click.spec.js Outdated Show resolved Hide resolved
expect(await page.evaluate('window.clicked')).toBe(2);
expect(await page.evaluate('document.querySelector("#button").style.left')).toBe('0px');
await page.evaluate(transition => {
window.setInterval(animateLeft, transition);
Copy link
Contributor

Choose a reason for hiding this comment

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

If we care specifically about the rafs, then this should probably be animated on raf right?
I'm not sure what we are testing, but if I was reviewing this code for a website I would say this is broken. You should always animate on raf, not setInterval.

test/click.spec.js Outdated Show resolved Hide resolved
dgozman and others added 2 commits February 18, 2020 13:58
Co-Authored-By: Joel Einbinder <joel.einbinder@gmail.com>
Co-Authored-By: Joel Einbinder <joel.einbinder@gmail.com>
@dgozman dgozman merged commit 1805acd into microsoft:master Feb 18, 2020
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.

2 participants