Skip to content

Commit

Permalink
fix: e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
federicoisepponfincons committed Oct 24, 2023
1 parent b59c917 commit 0a29342
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/sbb-skiplink-list/sbb-skiplink-list.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { assert, expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js';
import { waitForLitRender } from '../../global/testing';
import { SbbSkiplinkList } from './sbb-skiplink-list';
import '../sbb-skiplink-list';

describe('sbb-skiplink-list', () => {
/** NOTE: These are too hard to migrate and are prone to errors :/
Expand All @@ -10,24 +11,24 @@ describe('sbb-skiplink-list', () => {
let element: SbbSkiplinkList;

beforeEach(async () => {
await fixture(html`
element = await fixture(html`
<sbb-skiplink-list>
<sbb-link href="1">Link 1</sbb-link>
<sbb-link href="2">Link 2</sbb-link>
<sbb-link href="3">Link 3</sbb-link>
</sbb-skiplink-list>
<button id="button">Focus me</button>
`);
element = document.querySelector('sbb-skiplink-list');
});

it('renders', async () => {
assert.instanceOf(element, SbbSkiplinkList);
});

it('should be visible on focus', async () => {
const listItemLinks = await page.findAll('sbb-skiplink-list >>> li');
expect(listItemLinks).toHaveLength(3);
const listItemLinks = await element.shadowRoot.querySelectorAll('li');
expect(listItemLinks).not.to.be.null;
expect(listItemLinks.length).to.be.equal(3);

const getProperty = async (el: E2EElement, prop: string): Promise<string> => {
return (await el.getComputedStyle()).getPropertyValue(prop);
Expand Down

0 comments on commit 0a29342

Please sign in to comment.