Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(tabs): added axe tree test for aria selected state #2886

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading