mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-14 16:52:26 +08:00
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
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');
|
|
})
|
|
})
|