Skip to content

Commit

Permalink
test: fix hanging promises
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdyman committed Dec 17, 2023
1 parent 97ac38d commit ad40df3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/ExampleRepo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ test.describe('Example Repo', () => {
const getComponentRoot = (page: Page) => page.getByRole('slider');

test.beforeEach(async ({ page }) => {
await page.goto(`http://localhost:${process.env.PORT}/?debug`);
await page.goto(`http://localhost:${process.env.PORT}`);
await injectAxe(page);

configureAxe(page, {
await configureAxe(page, {
checks: [
{ id: 'page-has-heading-one', enabled: false },
{ id: 'meta-viewport', enabled: false },
{ id: 'region', enabled: false },
],
});
await checkA11y(page);
});

test.afterEach(async ({ page }) => {
Expand Down Expand Up @@ -85,17 +85,17 @@ test.describe('Example Repo', () => {
await component.click();
await expect(component).toBeFocused();

page.waitForTimeout(200);
await page.waitForTimeout(200);

// Should automatically rotate until mouse down is fired.
const lastValueNow = await component.getAttribute('aria-valuenow').then(Number);
await expect(lastValueNow).toBeGreaterThan(initialValueNow);
expect(lastValueNow).toBeGreaterThan(initialValueNow);

// Fire initial click to set dragging origin.
await page.mouse.move(512, 200);
await page.mouse.down();

page.waitForTimeout(200);
await page.waitForTimeout(200);
await expect(component).toHaveAttribute('aria-valuenow', lastValueNow.toString());

// Should navigate forwards when dragging right while mouse is down.
Expand Down

0 comments on commit ad40df3

Please sign in to comment.