Fix failing "out of view" tests in /tests/plugins/balloontoolbar/positioning
#4590
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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.
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 of48.6953125
to48.6875
(it's11/16
) and further in test we round to 2nd decimal place so we have48.70
vs48.69
(these values slightly differ depending on browsers and environment - even the change of0.001px
makes a difference here. That's why it works elsewhere). Since the issue is caused by the accuracy of the measuring tools, we couldIMHO 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.