Skip to content

Commit 088ef57

Browse files
authored
test: migrate wdio tests to cypress (#12106)
1 parent 1ba3c48 commit 088ef57

File tree

10 files changed

+565
-445
lines changed

10 files changed

+565
-445
lines changed

packages/fiori/test/specs/Components.spec.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/fiori/test/specs/F6Handling.spec.js

Lines changed: 0 additions & 158 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import Calendar from "../../src/Calendar.js";
2+
import "@ui5/webcomponents-localization/dist/features/calendar/Islamic.js";
3+
import "@ui5/webcomponents-localization/dist/features/calendar/Gregorian.js";
4+
import { resetConfiguration } from "@ui5/webcomponents-base/dist/InitialConfiguration.js";
5+
6+
7+
describe("Calendar general interaction", () => {
8+
before(() => {
9+
cy.window()
10+
.then($el => {
11+
const scriptElement = document.createElement("script");
12+
scriptElement.type = "application/json";
13+
scriptElement.setAttribute("data-ui5-config", "true");
14+
scriptElement.innerHTML = JSON.stringify({
15+
"calendarType": "Islamic",
16+
"secondaryCalendarType": "Gregorian"
17+
});
18+
19+
return $el.document.head.append(scriptElement);
20+
})
21+
22+
cy.wrap({ resetConfiguration })
23+
.invoke("resetConfiguration", true);
24+
});
25+
26+
after(() => {
27+
cy.window()
28+
.then($el => {
29+
const scriptElement = $el.document.head.querySelector("script[data-ui5-config]");
30+
31+
scriptElement?.remove();
32+
})
33+
})
34+
35+
it("Calendar type configured", () => {
36+
cy.mount(<Calendar></Calendar>);
37+
38+
cy.get("[ui5-calendar]")
39+
.should("not.have.prop", "primaryCalendarType");
40+
41+
cy.get("[ui5-calendar]")
42+
.should("not.have.prop", "secondaryCalendarType");
43+
44+
cy.get("[ui5-calendar]")
45+
.should("have.prop", "_primaryCalendarType", "Islamic")
46+
47+
cy.get("[ui5-calendar]")
48+
.should("have.prop", "_secondaryCalendarType", "Gregorian");
49+
});
50+
});

0 commit comments

Comments
 (0)