Skip to content

Commit

Permalink
test(tabs): added axe tree test for aria selected state (#2886)
Browse files Browse the repository at this point in the history
* test(tabs): added axe tree test for aria selected state

* test(tabs): updated axe tree tests to use ax helpers
  • Loading branch information
AdityaPatil22 authored Dec 11, 2024
1 parent 5940f37 commit 62b9312
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions elements/pf-tabs/test/pf-tabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ describe('<pf-tabs>', function() {
expect(second).to.have.attribute('active');
expect(third).to.not.have.attribute('active');
});

it('should specify the selected tab to assistive technology', async function() {
expect(await a11ySnapshot()).to.axContainQuery({ role: 'tabpanel', name: 'tab-2' });
});
});

describe('pressing ArrowLeft', function() {
Expand All @@ -254,6 +258,11 @@ describe('<pf-tabs>', function() {
expect(second).to.not.have.attribute('active');
expect(third).to.have.attribute('active');
});

it('should specify the selected tab to assistive technology', async function() {
expect(await a11ySnapshot()).to.axContainQuery({ role: 'tabpanel', name: 'tab-3' });
});

describe('then pressing ArrowRight', function() {
beforeEach(async function() {
await sendKeys({ down: 'ArrowRight' });
Expand All @@ -267,6 +276,10 @@ describe('<pf-tabs>', function() {
expect(second).to.not.have.attribute('active');
expect(third).to.not.have.attribute('active');
});

it('should specify the selected tab to assistive technology', async function() {
expect(await a11ySnapshot()).to.axContainQuery({ role: 'tabpanel', name: 'tab-1' });
});
});
});
});
Expand Down

0 comments on commit 62b9312

Please sign in to comment.