From 62b931230ecf466eb5dbf967cf1c04c7cf8fe8f4 Mon Sep 17 00:00:00 2001 From: Aditya Patil <121920458+AdityaP7649@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:34:38 +0530 Subject: [PATCH] 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 --- elements/pf-tabs/test/pf-tabs.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/elements/pf-tabs/test/pf-tabs.spec.ts b/elements/pf-tabs/test/pf-tabs.spec.ts index a8c7c3484d..419f3b28cd 100644 --- a/elements/pf-tabs/test/pf-tabs.spec.ts +++ b/elements/pf-tabs/test/pf-tabs.spec.ts @@ -241,6 +241,10 @@ describe('', 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() { @@ -254,6 +258,11 @@ describe('', 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' }); @@ -267,6 +276,10 @@ describe('', 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' }); + }); }); }); });