-
Notifications
You must be signed in to change notification settings - Fork 664
Navigation: Fix unstable Qunit tests #32192
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
Open
dmlvr
wants to merge
8
commits into
DevExpress:26_1
Choose a base branch
from
dmlvr:3180_26_1_fix_unstable_tests
base: 26_1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1f69cb8
delete splitter test
dmlvr a9d2910
delete tabPanel.repaintChangesOnly test
dmlvr 6a14e55
delete baseWidget test
dmlvr 45c22c9
unskiped and fix expected result in drawer tests
dmlvr eb444b5
fix drawer.scenarios.tests
dmlvr dd44390
unskiped and fix vectorMap projection.tests to viewport
dmlvr 2954a8e
Merge branch '26_1' into 3180_26_1_fix_unstable_tests
dmlvr f1b66a2
skip-cache
dmlvr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -704,15 +704,15 @@ $.each([null, [-180, 90, 180, -20], [-50, 90, 180, -90], [-180, 20, 180, -90], [ | |
| assert.arraysEqual(this.projection2.getViewport(), this.projection1.getViewport()); | ||
| }); | ||
|
|
||
| QUnit.skip('Northern edge - to viewport' + namePart, function(assert) { | ||
| QUnit.test('Northern edge - to viewport' + namePart, function(assert) { | ||
| this.setBounds(bounds); | ||
|
|
||
| this.projection1.setZoom(2).setCenter([0, 80]); | ||
|
|
||
| this.projection1.setZoom(2); | ||
| this.projection1.setCenter([0, 80]); | ||
| this.projection2.setViewport(this.projection1.getViewport()); | ||
|
|
||
| assert.roughEqual(this.projection2.getZoom(), this.projection1.getZoom(), 1E-8, 'zoom'); | ||
| assert.arraysEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center'); | ||
| assert.arraysRoughEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center'); | ||
| }); | ||
|
|
||
| QUnit.test('Northern edge - from viewport' + namePart, function(assert) { | ||
|
|
@@ -726,15 +726,16 @@ $.each([null, [-180, 90, 180, -20], [-50, 90, 180, -90], [-180, 20, 180, -90], [ | |
| assert.arraysEqual(this.projection2.getViewport(), this.projection1.getViewport()); | ||
| }); | ||
|
|
||
| QUnit.skip('Eastern edge - to viewport' + namePart, function(assert) { | ||
| QUnit.test('Eastern edge - to viewport' + namePart, function(assert) { | ||
| this.setBounds(bounds); | ||
|
|
||
| this.projection1.setZoom(1.75).setCenter([170, 15]); | ||
| this.projection1.setZoom(1.75); | ||
| this.projection1.setCenter([170, 15]); | ||
|
|
||
| this.projection2.setViewport(this.projection1.getViewport()); | ||
|
|
||
| assert.roughEqual(this.projection2.getZoom(), this.projection1.getZoom(), 1E-8, 'zoom'); | ||
| assert.arraysEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center'); | ||
| assert.arraysRoughEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center'); | ||
| }); | ||
|
|
||
| QUnit.test('Eastern edge - from viewport' + namePart, function(assert) { | ||
|
|
@@ -748,15 +749,16 @@ $.each([null, [-180, 90, 180, -20], [-50, 90, 180, -90], [-180, 20, 180, -90], [ | |
| assert.arraysEqual(this.projection2.getViewport(), this.projection1.getViewport()); | ||
| }); | ||
|
|
||
| QUnit.skip('Southern edge - to viewport' + namePart, function(assert) { | ||
| QUnit.test('Southern edge - to viewport' + namePart, function(assert) { | ||
| this.setBounds(bounds); | ||
|
|
||
| this.projection1.setZoom(2.3).setCenter([50, -75]); | ||
| this.projection1.setZoom(2.3); | ||
| this.projection1.setCenter([50, -75]); | ||
|
|
||
| this.projection2.setViewport(this.projection1.getViewport()); | ||
|
|
||
| assert.roughEqual(this.projection2.getZoom(), this.projection1.getZoom(), 1E-8, 'zoom'); | ||
| assert.arraysEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center'); | ||
| assert.arraysRoughEqual(this.projection2.getCenter(), this.projection1.getCenter(), 'center'); | ||
| }); | ||
|
|
||
| QUnit.test('Southern edge - from viewport' + namePart, function(assert) { | ||
|
|
@@ -1469,3 +1471,21 @@ QUnit.assert.arraysEqual = function(actual, expected, message, epsilon) { | |
| message: message | ||
| }); | ||
| }; | ||
|
|
||
dmlvr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| QUnit.assert.arraysRoughEqual = function(actual, expected, message, percentTolerance = 10) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let’s not add new helper functions for this purpose. I suggest removing it and fixing the current expected values directly in the tests |
||
| const equal = expected.every((expectedVal, i) => { | ||
| const actualVal = actual[i]; | ||
| const relativeError = expectedVal !== 0 | ||
| ? Math.abs((actualVal - expectedVal) / expectedVal) * 100 | ||
| : Math.abs(actualVal); | ||
|
|
||
| return relativeError <= percentTolerance; | ||
| }); | ||
|
|
||
| this.pushResult({ | ||
| result: equal, | ||
| actual, | ||
| expected, | ||
| message: `${message}${equal ? '' : ` (tolerance: ${percentTolerance}%)`}` | ||
| }); | ||
| }; | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, it looks the same as before. I suggest we fix the current valid values for unsupported scenarios here and consider them correct.