-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix DropDownEditor Popup position depending the "rtlEnabled" option v…
…alue (T856114) (#11687) (#11694) * Fix DropDownEditor Popup position depending the "rtlEnabled" option value (T856114) (#11687) * fix after cherrypick
- Loading branch information
Showing
4 changed files
with
122 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import config from 'core/config'; | ||
import { getDefaultAlignment } from 'core/utils/position.js'; | ||
|
||
const { module: testModule, test } = QUnit; | ||
|
||
testModule('getDefaultAlignment', function() { | ||
test('getDefaultAlignment should return an alignment depending on the global "rtlEnabled" config or passed value', function(assert) { | ||
const originalConfig = config(); | ||
|
||
try { | ||
config({ | ||
rtlEnabled: false | ||
}); | ||
|
||
assert.strictEqual(getDefaultAlignment(), 'left', '"isRtlEnabled" argument is undefined, global "rtlEnabled" config is false'); | ||
assert.strictEqual(getDefaultAlignment(true), 'right', '"isRtlEnabled" argument is true, global "rtlEnabled" config is false'); | ||
assert.strictEqual(getDefaultAlignment(false), 'left', '"isRtlEnabled" argument is false, global "rtlEnabled" config is false'); | ||
|
||
config({ | ||
rtlEnabled: true | ||
}); | ||
|
||
assert.strictEqual(getDefaultAlignment(), 'right', '"isRtlEnabled" argument is undefined, global "rtlEnabled" config is true'); | ||
assert.strictEqual(getDefaultAlignment(true), 'right', '"isRtlEnabled" argument is true, global "rtlEnabled" config is true'); | ||
assert.strictEqual(getDefaultAlignment(false), 'left', '"isRtlEnabled" argument is false, global "rtlEnabled" config is true'); | ||
|
||
} finally { | ||
config(originalConfig); | ||
} | ||
}); | ||
}); |
This file contains 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