Skip to content

Commit

Permalink
Revert "test(autocomplete): a11y snapshot example"
Browse files Browse the repository at this point in the history
This reverts commit 11ed9ed.
  • Loading branch information
TomMenga committed Jan 30, 2024
1 parent 11ed9ed commit b35a370
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/components/autocomplete/autocomplete.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { assert, expect, fixture } from '@open-wc/testing';
import {
a11ySnapshot,
findAccessibilityNode,
sendKeys,
sendMouse,
} from '@web/test-runner-commands';
import { sendKeys, sendMouse } from '@web/test-runner-commands';
import { html } from 'lit/static-html.js';

import { waitForCondition, waitForLitRender, EventSpy } from '../core/testing';
Expand Down Expand Up @@ -32,18 +27,16 @@ describe('sbb-autocomplete', () => {
element = formField.querySelector<SbbAutocompleteElement>('sbb-autocomplete')!;
});

it('renders and sets the correct attributes', async () => {
it('renders and sets the correct attributes', () => {
assert.instanceOf(formField, SbbFormFieldElement);
assert.instanceOf(element, SbbAutocompleteElement);

const snapshot = await a11ySnapshot({});
const combobox = findAccessibilityNode<any>(snapshot, (node) => node.role === 'combobox');
expect(combobox).not.to.be.null;
expect(combobox.autocomplete).to.be.equal('list');
expect(combobox.haspopup).to.be.equal('listbox');

expect(element).not.to.have.attribute('autocomplete-origin-borderless');

expect(input).to.have.attribute('autocomplete', 'off');
expect(input).to.have.attribute('role', 'combobox');
expect(input).to.have.attribute('aria-autocomplete', 'list');
expect(input).to.have.attribute('aria-haspopup', 'listbox');
expect(input).to.have.attribute('aria-controls', 'myAutocomplete');
expect(input).to.have.attribute('aria-owns', 'myAutocomplete');
expect(input).to.have.attribute('aria-expanded', 'false');
Expand Down

0 comments on commit b35a370

Please sign in to comment.