Skip to content

Commit 62b9312

Browse files
authoredDec 11, 2024··
test(tabs): added axe tree test for aria selected state (#2886)
* test(tabs): added axe tree test for aria selected state * test(tabs): updated axe tree tests to use ax helpers
1 parent 5940f37 commit 62b9312

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎elements/pf-tabs/test/pf-tabs.spec.ts

+13
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ describe('<pf-tabs>', function() {
241241
expect(second).to.have.attribute('active');
242242
expect(third).to.not.have.attribute('active');
243243
});
244+
245+
it('should specify the selected tab to assistive technology', async function() {
246+
expect(await a11ySnapshot()).to.axContainQuery({ role: 'tabpanel', name: 'tab-2' });
247+
});
244248
});
245249

246250
describe('pressing ArrowLeft', function() {
@@ -254,6 +258,11 @@ describe('<pf-tabs>', function() {
254258
expect(second).to.not.have.attribute('active');
255259
expect(third).to.have.attribute('active');
256260
});
261+
262+
it('should specify the selected tab to assistive technology', async function() {
263+
expect(await a11ySnapshot()).to.axContainQuery({ role: 'tabpanel', name: 'tab-3' });
264+
});
265+
257266
describe('then pressing ArrowRight', function() {
258267
beforeEach(async function() {
259268
await sendKeys({ down: 'ArrowRight' });
@@ -267,6 +276,10 @@ describe('<pf-tabs>', function() {
267276
expect(second).to.not.have.attribute('active');
268277
expect(third).to.not.have.attribute('active');
269278
});
279+
280+
it('should specify the selected tab to assistive technology', async function() {
281+
expect(await a11ySnapshot()).to.axContainQuery({ role: 'tabpanel', name: 'tab-1' });
282+
});
270283
});
271284
});
272285
});

0 commit comments

Comments
 (0)
Please sign in to comment.