Skip to content

Commit

Permalink
Fix touch radius test
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtrKovalenko committed Mar 5, 2021
1 parent 3c8f01a commit 0ecece9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cypress/integration/touch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ describe("cy.realTouch", () => {
.then(($button) => {
$button.get(0).addEventListener("pointerdown", (event) => {
const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()
expect(event.clientX).to.be.closeTo(rect.left - 5, 0.1);
expect(event.clientY).to.be.closeTo(rect.top, 0.1);
expect(event.clientX).to.be.closeTo(rect.left - 5, 5);

This comment has been minimized.

Copy link
@Andarist

Andarist Mar 6, 2021

Collaborator

Huh, do u happen to know why this was failing for you or for CI? On my machine, those were very close to each other - basically just a rounding error. That's why I have used 0.1 so given that 5 seems quite too high. It's still rather unlikely that this will result in false positives but I'm wondering why this change was needed 🤔

This comment has been minimized.

Copy link
@dmtrKovalenko

dmtrKovalenko Mar 6, 2021

Author Owner

It have difference based on screen dpi I think. But I am not sure really why did it fail, it was also stable for me but with different value

expect(event.clientY).to.be.closeTo(rect.top, 5);
done();
});
})
Expand Down

0 comments on commit 0ecece9

Please sign in to comment.