Skip to content

Commit d47075b

Browse files
ilhan007plamenivanov91
authored andcommitted
chore: add wdio tests for RTL mode (SAP#959)
FIXES: SAP#957
1 parent 422a49a commit d47075b

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

packages/main/test/pages/Button.html

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
<script data-ui5-config type="application/json">
1313
{
14-
"rtl": false,
1514
"compactSize": false
1615
}
1716
</script>

packages/main/test/specs/RTL.spec.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const assert = require("chai").assert;
2+
3+
describe("RTL", () => {
4+
it("language forces RTL, if RTL not specified", () => {
5+
browser.url("http://localhost:8080/test-resources/pages/Button.html?sap-ui-language=he");
6+
7+
const buttonRoot = browser.$("#button1").shadow$(".ui5-button-root");
8+
assert.strictEqual(buttonRoot.getProperty("dir"), "rtl", "dir is correctly set");
9+
});
10+
11+
it("config forces RTL", () => {
12+
browser.url("http://localhost:8080/test-resources/pages/Button.html?sap-ui-rtl=true");
13+
14+
const buttonRoot = browser.$("#button1").shadow$(".ui5-button-root");
15+
assert.strictEqual(buttonRoot.getProperty("dir"), "rtl", "dir is correctly set");
16+
});
17+
18+
it("config unsets RTL, although rtl language is used", () => {
19+
browser.url("http://localhost:8080/test-resources/pages/Button.html?sap-ui-rtl=false&sap-ui-language=he");
20+
21+
const buttonRoot = browser.$("#button1").shadow$(".ui5-button-root");
22+
assert.notOk(buttonRoot.getProperty("dir"), "dir is not present");
23+
});
24+
});

0 commit comments

Comments
 (0)