diff --git a/CHANGELOG.md b/CHANGELOG.md index 0149b8eb7..26d2d2316 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ * Conform ``'s internal state when dataOptions prop changes after initial render. Refs STCOM-1313. * Add the `showSortIndicator` property to MLC to display a sort indicator next to the sortable column names. Refs STCOM-1328. * Expose `aria-label` for SearchField Index ` + + + + + + + + + + + + ); + }); + + it('has no axe errors', () => runAxeTest); + + it('has a button', () => Button('test1').exists()); + + it('should call onRegisterAccordion callback', () => { + return expect(onRegisterAccordionSpy.calledWith('test1')).to.be.true; + }); + + describe('contents ready for interaction following open', () => { + beforeEach(async () => { + await first.clickHeader(); + await Bigtest.TextField({ id: 'testControl1' }).fillIn('test'); + }); + + it('Child element was filled out successfully', () => Bigtest.TextField({id: 'testControl1'}).has({ value: 'test' })); + }); + + describe('keyboard navigation: next accordion', () => { + beforeEach(async () => { + await first.focus(); + await Focused('test1').pressKey('ArrowDown'); + }); + + it('second accordion is in focus', async () => second.is({ focused: true })); + }); + + describe('keyboard navigation: previous accordion', () => { + beforeEach(async () => { + await second.focus(); + await Focused('test2').pressKey('ArrowUp'); + }); + + it('first accordion is in focus', async () => first.is({ focused: true })); + }); + + describe('keyboard navigation: last accordion', () => { + beforeEach(async () => { + await first.focus(); + await Focused('test1').pressKey('End'); + }); + + it('Last accordion is in focus', async () => last.is({ focused: true })); + }); + + describe('keyboard navigation: first accordion', () => { + beforeEach(async () => { + await last.focus(); + await Focused('test4').pressKey('Home'); + }); + + it('First accordion is in focus', async () => first.is({ focused: true })); + }); +}); + describe('unmounting Accordion - as part of an AccordionSet', () => { const onUnregisterAccordionSpy = sinon.spy(); diff --git a/lib/FilterGroups/tests/FilterGroups-test.js b/lib/FilterGroups/tests/FilterGroups-test.js index f32343277..6b2a18f66 100644 --- a/lib/FilterGroups/tests/FilterGroups-test.js +++ b/lib/FilterGroups/tests/FilterGroups-test.js @@ -84,6 +84,8 @@ describe('Filter Group', () => { ])); it('has Clear button', () => FilterAccordion('Item Types').has({ clearButton: false })); + + it('toggle is in focus', () => Button('Item Types').is({ focused: true })); }); }); });