-
Notifications
You must be signed in to change notification settings - Fork 13.5k
/
Copy pathoverlays-keep-contents-mounted.cy.js
60 lines (46 loc) · 2 KB
/
overlays-keep-contents-mounted.cy.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
describe('overlays - keepContentsMounted', () => {
beforeEach(() => {
cy.viewport(1000, 900);
cy.visit('/keep-contents-mounted')
})
describe('modal', () => {
it('should not mount component if false', () => {
cy.get('ion-modal#default-modal ion-content').should('not.exist');
});
it('should mount component if true', () => {
cy.get('ion-modal#auto-mount-modal ion-content').should('exist');
});
it('should keep component mounted after dismissing if true', () => {
cy.get('#open-auto-mount-modal').click();
cy.get('ion-modal#auto-mount-modal ion-content').should('exist');
cy.get('ion-modal#auto-mount-modal #dismiss').click();
cy.get('ion-modal#auto-mount-modal')
.should('not.be.visible')
.should('have.class', 'overlay-hidden');
cy.get('ion-modal#auto-mount-modal ion-content').should('exist');
});
it('should mount content if passed as attribute', () => {
cy.get('ion-modal#auto-mount-modal-attribute ion-content').should('exist');
});
it('should not mount content if passed as attribute with a value of false', () => {
cy.get('ion-modal#auto-mount-modal-attribute-false ion-content').should('not.exist');
});
})
describe('popover', () => {
it('should not mount component if false', () => {
cy.get('ion-popover#default-popover ion-content').should('not.exist');
});
it('should mount component if true', () => {
cy.get('ion-popover#auto-mount-popover ion-content').should('exist');
});
it('should keep component mounted after dismissing if true', () => {
cy.get('#open-auto-mount-popover').click();
cy.get('ion-popover#auto-mount-popover ion-content').should('exist');
cy.get('ion-popover#auto-mount-popover #dismiss').click();
cy.get('ion-popover#auto-mount-popover')
.should('not.be.visible')
.should('have.class', 'overlay-hidden');
cy.get('ion-popover#auto-mount-popover ion-content').should('exist');
});
})
})