mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
chore(): resolve merge conflicts
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
describe('Nested', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('http://localhost:8080/nested');
|
||||
cy.ionPageVisible('nestedchild');
|
||||
});
|
||||
|
||||
it('should show first page', () => {
|
||||
|
@ -203,6 +203,71 @@ describe('Tabs', () => {
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab1').should('not.have.class', 'tab-selected');
|
||||
});
|
||||
|
||||
// Verifies fix for https://github.com/ionic-team/ionic-framework/issues/23101
|
||||
it('should return to previous tab instance when using the ion-back-button', () => {
|
||||
cy.visit('http://localhost:8080/tabs/tab1');
|
||||
|
||||
cy.get('#tabs-secondary').click();
|
||||
cy.ionPageHidden('tabs');
|
||||
cy.ionPageVisible('tab1-secondary');
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab2-secondary').click();
|
||||
cy.ionPageHidden('tab1-secondary');
|
||||
cy.ionPageVisible('tab2-secondary');
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab1-secondary').click();
|
||||
cy.ionPageHidden('tab2-secondary');
|
||||
cy.ionPageVisible('tab1-secondary');
|
||||
|
||||
cy.ionBackClick('tab1-secondary');
|
||||
cy.ionPageDoesNotExist('tabs-secondary');
|
||||
cy.ionPageVisible('tab1');
|
||||
});
|
||||
|
||||
// Verifies fix for https://github.com/ionic-team/ionic-framework/issues/23087
|
||||
it('should return to correct view and url when going back from child page after switching tabs', () => {
|
||||
cy.visit('http://localhost:8080/tabs/tab1');
|
||||
|
||||
cy.get('#child-one').click();
|
||||
cy.ionPageHidden('tab1');
|
||||
cy.ionPageVisible('tab1childone');
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab2').click();
|
||||
cy.ionPageHidden('tab1childone');
|
||||
cy.ionPageVisible('tab2');
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab1').click();
|
||||
cy.ionPageHidden('tab2');
|
||||
cy.ionPageVisible('tab1childone');
|
||||
|
||||
cy.ionBackClick('tab1childone');
|
||||
cy.ionPageDoesNotExist('tab1childone');
|
||||
cy.ionPageVisible('tab1');
|
||||
|
||||
cy.url().should('include', '/tabs/tab1');
|
||||
});
|
||||
|
||||
// Verifies fix for https://github.com/ionic-team/ionic-framework/issues/22847
|
||||
it('should support dynamic tabs', () => {
|
||||
cy.visit('http://localhost:8080/tabs/tab1');
|
||||
|
||||
cy.ionPageVisible('tab1');
|
||||
|
||||
cy.get('ion-tab-button').its('length').should('equal', 3);
|
||||
cy.get('ion-tab-button#tab-button-tab1').should('have.class', 'tab-selected');
|
||||
|
||||
cy.get('#add-tab').click();
|
||||
|
||||
cy.get('ion-tab-button').its('length').should('equal', 4);
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab4').click();
|
||||
cy.ionPageVisible('tab4');
|
||||
cy.ionPageHidden('tab1');
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab1').should('not.have.class', 'tab-selected');
|
||||
cy.get('ion-tab-button#tab-button-tab4').should('have.class', 'tab-selected');
|
||||
});
|
||||
})
|
||||
|
||||
describe('Tabs - Swipe to Go Back', () => {
|
||||
@ -214,11 +279,15 @@ describe('Tabs - Swipe to Go Back', () => {
|
||||
cy.ionPageVisible('tab1')
|
||||
});
|
||||
|
||||
it('should swipe and abort', () => {
|
||||
// TODO: Flaky if test runner is slow
|
||||
// Delays between gesture movements
|
||||
// cause swipe back gesture to think
|
||||
// velocity is higher than it actually is
|
||||
/*it('should swipe and abort', () => {
|
||||
cy.ionSwipeToGoBack();
|
||||
cy.ionPageHidden('home');
|
||||
cy.ionPageVisible('tab1');
|
||||
});
|
||||
});*/
|
||||
|
||||
it('should swipe and go back to home', () => {
|
||||
cy.ionSwipeToGoBack(true);
|
||||
|
@ -47,12 +47,6 @@ Cypress.Commands.add('ionPageVisible', (pageId) => {
|
||||
.should('have.length', 1)
|
||||
})
|
||||
|
||||
Cypress.Commands.add('ionPageInvisible', (pageId) => {
|
||||
cy.get(`div.ion-page[data-pageid=${pageId}]`)
|
||||
.should('have.class', 'ion-page-invisible')
|
||||
.should('have.length', 1)
|
||||
})
|
||||
|
||||
Cypress.Commands.add('ionPageHidden', (pageId) => {
|
||||
cy.get(`div.ion-page[data-pageid=${pageId}]`)
|
||||
.should('have.class', 'ion-page-hidden')
|
||||
|
@ -358,4 +358,39 @@ describe('Routing', () => {
|
||||
const cmpAgain = wrapper.findComponent(Page1);
|
||||
expect(cmpAgain.props()).toEqual({ title: 'abc Title' });
|
||||
});
|
||||
|
||||
// Verifies fix for https://github.com/ionic-team/ionic-framework/pull/23189
|
||||
it('should update props on a parameterized url', async () => {
|
||||
const Page = {
|
||||
props: {
|
||||
id: { type: String, default: 'Default ID' }
|
||||
},
|
||||
components: { IonPage },
|
||||
template: `<ion-page>{{ $props.id }}</ion-page>`
|
||||
}
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(process.env.BASE_URL),
|
||||
routes: [
|
||||
{ path: '/page/:id', component: Page, props: true },
|
||||
{ path: '/', redirect: '/page/1' }
|
||||
]
|
||||
});
|
||||
|
||||
router.push('/');
|
||||
await router.isReady();
|
||||
const wrapper = mount(App, {
|
||||
global: {
|
||||
plugins: [router, IonicVue]
|
||||
}
|
||||
});
|
||||
|
||||
const page = wrapper.findComponent(Page);
|
||||
expect(page.props()).toEqual({ id: '1' });
|
||||
|
||||
router.push('/page/2');
|
||||
await waitForRouter();
|
||||
|
||||
expect(page.props()).toEqual({ id: '2' });
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user