Skip to content

Commit abb3b9a

Browse files
committed
test(tabs): updated axe tree tests to use ax helpers
1 parent b044e06 commit abb3b9a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,7 @@ describe('<pf-tabs>', function() {
243243
});
244244

245245
it('should specify the selected tab to assistive technology', async function() {
246-
const snapshot = await a11ySnapshot();
247-
expect(snapshot.children?.find(x => x.role === 'tabpanel')?.name).to.equal('tab-2');
246+
expect(await a11ySnapshot()).to.axContainQuery({ role: 'tabpanel', name: 'tab-2' });
248247
});
249248
});
250249

@@ -261,8 +260,7 @@ describe('<pf-tabs>', function() {
261260
});
262261

263262
it('should specify the selected tab to assistive technology', async function() {
264-
const snapshot = await a11ySnapshot();
265-
expect(snapshot.children?.find(x => x.role === 'tabpanel')?.name).to.equal('tab-3');
263+
expect(await a11ySnapshot()).to.axContainQuery({ role: 'tabpanel', name: 'tab-3' });
266264
});
267265

268266
describe('then pressing ArrowRight', function() {
@@ -280,8 +278,7 @@ describe('<pf-tabs>', function() {
280278
});
281279

282280
it('should specify the selected tab to assistive technology', async function() {
283-
const snapshot = await a11ySnapshot();
284-
expect(snapshot.children?.find(x => x.role === 'tabpanel')?.name).to.equal('tab-1');
281+
expect(await a11ySnapshot()).to.axContainQuery({ role: 'tabpanel', name: 'tab-1' });
285282
});
286283
});
287284
});

0 commit comments

Comments
 (0)