fix(vue): adding class to IonPage no longer hides component (#25490)

This commit is contained in:
Liam DeBeasi
2022-06-21 12:42:50 -04:00
committed by GitHub
parent 7821df2f5e
commit cbaa9711f0
3 changed files with 28 additions and 6 deletions

View File

@ -62,4 +62,25 @@ describe('IonPage', () => {
expect(cmp.classes('ion-page')).toBe(true);
expect(cmp.classes('custom-class')).toBe(true);
});
it('should not re-add ion-page-invisible when setting the class', async () => {
const Page1 = {
template: `<ion-page :class="{ 'custom-class': addClass }"></ion-page>`,
name: 'Page1',
components: { IonPage },
data() {
return {
addClass: false
}
}
};
const wrapper = mount(Page1);
expect(wrapper.classes('custom-class')).toBe(false);
await wrapper.setData({ addClass: true });
expect(wrapper.classes('custom-class')).toBe(true);
expect(wrapper.classes('ion-page-invisible')).toBe(false);
});
})