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

Fix failing "out of view" tests in /tests/plugins/balloontoolbar/positioning #4590

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

Dumluregn
Copy link
Contributor

@Dumluregn Dumluregn commented Mar 25, 2021

What is the purpose of this pull request?

Bug fix

Does your PR contain necessary tests?

All patches that change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

Did you follow the CKEditor 4 code style guide?

Your code should follow the guidelines from the CKEditor 4 code style guide which helps keep the entire codebase consistent.

  • PR is consistent with the code style guide

What is the proposed changelog entry for this pull request?

Skip

What changes did you make?

The tests seem to fail because of the roundings. getClientRect() method rounds left balloon position of
48.6953125 to 48.6875 (it's 11/16) and further in test we round to 2nd decimal place so we have 48.70 vs 48.69 (these values slightly differ depending on browsers and environment - even the change of 0.001px makes a difference here. That's why it works elsewhere). Since the issue is caused by the accuracy of the measuring tools, we could

  1. find better tools (other functions for testing purpose),
  2. increase the error margin.

IMHO the difference in measurements is negligible and it would be a waste of time, so I've change testing procedure from 2nd decimal point accordance to 1st decimal point.

Which issues does your PR resolve?

Closes #4589.

@Comandeer Comandeer self-assigned this Apr 1, 2021
@Comandeer Comandeer changed the base branch from major to master April 1, 2021 14:32
@Comandeer
Copy link
Member

Changed base to master.

Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Failing "out of view" tests in /tests/plugins/balloontoolbar/positioning
2 participants