feat(toggle): expose label wrapper as shadow part (#28585)

This commit is contained in:
Liam DeBeasi
2023-11-30 14:03:51 -05:00
committed by GitHub
parent 52ed2bf637
commit a34188f7db
4 changed files with 16 additions and 7 deletions

View File

@ -40,6 +40,19 @@ describe('toggle', () => {
expect(t.enableOnOffLabels).toBe(true);
});
});
describe('shadow parts', () => {
it('should have shadow parts', async () => {
const page = await newSpecPage({
components: [Toggle],
html: `<ion-toggle>Label</ion-toggle>`,
});
const toggle = page.body.querySelector('ion-toggle')!;
expect(toggle).toHaveShadowPart('label');
expect(toggle).toHaveShadowPart('track');
expect(toggle).toHaveShadowPart('handle');
});
});
});
describe('ion-toggle: disabled', () => {