-
Notifications
You must be signed in to change notification settings - Fork 13.5k
/
Copy pathnested.cy.js
53 lines (43 loc) · 1.33 KB
/
nested.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
describe('Nested', () => {
beforeEach(() => {
cy.visit('/nested');
cy.ionPageVisible('nestedchild');
});
it('should go to second page', () => {
cy.get('#nested-child-two').click();
cy.ionPageVisible('nestedchildtwo');
cy.ionPageHidden('nestedchild');
});
it('should go back to first page', () => {
cy.get('#nested-child-two').click();
cy.ionBackClick('nestedchildtwo');
cy.ionPageVisible('nestedchild');
});
it('should go navigate across nested outlet contexts', () => {
cy.get('#nested-tabs').click();
cy.ionPageHidden('routeroutlet');
cy.ionPageVisible('tab1');
cy.ionBackClick('tab1');
cy.ionPageDoesNotExist('tab1');
cy.ionPageVisible('routeroutlet');
});
})
describe('Nested - Replace', () => {
it('should replace a route but still be able to go back to main outlet', () => {
cy.visit('/');
cy.ionPageVisible('home');
cy.routerPush('/nested');
cy.ionPageHidden('home');
cy.ionPageVisible('nestedchild');
cy.routerReplace('/nested/two');
cy.ionPageDoesNotExist('nestedchild');
cy.ionPageVisible('nestedchildtwo');
/**
* ionBackClick does not handle nested pages
* with multiple back buttons
*/
cy.get('#routeroutlet-back-button').click();
cy.ionPageDoesNotExist('nestedchildtwo');
cy.ionPageVisible('home');
})
})