Skip to content

Commit

Permalink
test(dropdown): skip aria attrs assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Mar 19, 2024
1 parent b114a86 commit f1ee6ff
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions elements/pf-dropdown/test/pf-dropdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import { expect, html } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { PfDropdown } from '@patternfly/elements/pf-dropdown/pf-dropdown.js';
import { a11ySnapshot, type A11yTreeSnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';
import { a11ySnapshot } from '@patternfly/pfe-tools/test/a11y-snapshot.js';

function press(key: string) {
return async function() {
await sendKeys({ press: key });
};
}

describe('<pf-dropdown>', function() {
let element: PfDropdown;
Expand Down Expand Up @@ -33,7 +39,12 @@ describe('<pf-dropdown>', function() {
});

it('should be accessible', async function() {
await expect(element).shadowDom.to.be.accessible();
await expect(element).to.be.accessible({
ignoredRules: [
/** @see https://github.com/dequelabs/axe-core/issues/4259 */
'aria-allowed-attr',
]
});
});

it('should hide dropdown content from assistive technology', async function() {
Expand All @@ -42,10 +53,8 @@ describe('<pf-dropdown>', function() {
});

describe('pressing Enter', function() {
beforeEach(async function() {
await sendKeys({ press: 'Tab' });
await sendKeys({ press: 'Enter' });
});
beforeEach(press('Tab'));
beforeEach(press('Enter'));

it('should show menu', async function() {
const snapshot = await a11ySnapshot();
Expand Down

0 comments on commit f1ee6ff

Please sign in to comment.