-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathSingleSelectWithInvalidValue.spec.js
More file actions
38 lines (31 loc) · 1.1 KB
/
SingleSelectWithInvalidValue.spec.js
File metadata and controls
38 lines (31 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
describe("single select with invalid initial value", () => {
beforeEach(() => {
cy.visit("/");
});
it("Single select radio with array value without user interaction keep its value", () => {
cy.loadFromJson("single_select_with_invalid_value.json", 0);
// init screen data
cy.setPreviewDataInput({ person: [] });
cy.get("[data-cy=mode-preview]").click();
// Check the data of the screen
cy.assertPreviewData({
person: []
});
});
it("Single select radio with array value after user interaction change to the selected option", () => {
cy.loadFromJson("single_select_with_invalid_value.json", 0);
// init screen data
cy.setPreviewDataInput({ person: [] });
cy.get("[data-cy=mode-preview]").click();
cy.get('[data-cy=preview-content] [id^="person-one-"]').click();
cy.get('[data-cy=preview-content] [id^="person-two-"]').click();
cy.get('[data-cy=preview-content] [id^="person-one-"]').click();
// Check the data of the screen
cy.assertPreviewData({
person: {
content: "one",
value: "one"
}
});
});
});