Skip to content

Commit

Permalink
Fixed #402, fixing defects in page loading end2end test.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Mar 3, 2024
1 parent 8f23b8c commit f1324dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http:
- Narrowed parsing of structure refinements to avoid conflicting with spreads in lists.
- Account for documented expressions in bind recurrence relations.
- More consistently concretize name types in binds.
- [#402](https://github.com/wordplaydev/wordplay/issues/402): Fixed defect in page loading test.

## 0.9.34 2024-02-24

Expand Down
32 changes: 15 additions & 17 deletions tests/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,34 @@ test('has Wordplay header', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'Wordplay' })).toBeVisible();
});

function clickLinkAndCheckHeader(page: Page, linkAndHeader: string) {
return async () => {
await page.goto('/');

// Click the get started link.
await page.getByRole('link', { name: linkAndHeader }).click();

// Expects page to have a heading with the name Wordplay.
await expect(
page.getByRole('heading', { name: linkAndHeader })
).toBeVisible();
};
async function clickLinkAndCheckHeader(page: Page, linkAndHeader: string) {
await page.goto('/');

// Click the first matching link.
await page.getByRole('link', { name: linkAndHeader }).nth(0).click();

// Expects page to have a heading with the name Wordplay.
await expect(
page.getByRole('heading', { name: linkAndHeader }),
).toBeVisible();
}

test('learn link works', async ({ page }) => {
clickLinkAndCheckHeader(page, 'Learn');
await clickLinkAndCheckHeader(page, 'Learn');
});

test('project link works', async ({ page }) => {
clickLinkAndCheckHeader(page, 'Projects');
await clickLinkAndCheckHeader(page, 'Projects');
});

test('galleries link works', async ({ page }) => {
clickLinkAndCheckHeader(page, 'Galleries');
await clickLinkAndCheckHeader(page, 'Galleries');
});

test('about link works', async ({ page }) => {
clickLinkAndCheckHeader(page, 'About');
await clickLinkAndCheckHeader(page, 'About');
});

test('rights link works', async ({ page }) => {
clickLinkAndCheckHeader(page, 'Rights');
await clickLinkAndCheckHeader(page, 'Rights');
});

0 comments on commit f1324dc

Please sign in to comment.