diff --git a/core/src/components/select/test/select.spec.tsx b/core/src/components/select/test/select.spec.tsx index ef1b23306a..f00c4c6688 100644 --- a/core/src/components/select/test/select.spec.tsx +++ b/core/src/components/select/test/select.spec.tsx @@ -125,3 +125,35 @@ describe('select: slot interactivity', () => { expect(divSpy).toHaveBeenCalled(); }); }); + +describe('ion-select: required', () => { + it('should have a aria-required attribute as true in inner button', async () => { + const page = await newSpecPage({ + components: [Select], + html: ` + + `, + }); + + const select = page.body.querySelector('ion-select')!; + + const nativeButton = select.shadowRoot!.querySelector('button')!; + + expect(nativeButton.getAttribute('aria-required')).toBe('true'); + }); + + it('should not have a aria-required attribute as false in inner button', async () => { + const page = await newSpecPage({ + components: [Select], + html: ` + + `, + }); + + const select = page.body.querySelector('ion-select')!; + + const nativeButton = select.shadowRoot!.querySelector('button')!; + + expect(nativeButton.getAttribute('aria-required')).toBe('false'); + }); +});