Skip to content

Commit

Permalink
test: ensure visibility assertions in footer and navbar tests are asy…
Browse files Browse the repository at this point in the history
…nchronous for consistency
  • Loading branch information
Bluzzi committed Oct 13, 2024
1 parent 2b5a672 commit f6bb6cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions test/footer-left.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test.describe("footer left link icons", () => {
target: await github.getAttribute("target")
};

expect(github).toBeVisible();
await expect(github).toBeVisible();
expect(githubAttributes.href).toBe(goscord.github.mainRepoUrl);
expect(githubAttributes.target).toBe("_blank");

Expand All @@ -31,7 +31,7 @@ test.describe("footer left link icons", () => {
target: await discord.getAttribute("target")
};

expect(discord).toBeVisible();
await expect(discord).toBeVisible();
expect(discordAttributes.href).toBe(goscord.discord.url);
expect(discordAttributes.target).toBe("_blank");

Expand Down
4 changes: 2 additions & 2 deletions test/footer-right.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ test.describe("footer right sections", () => {

const title = footer.getByRole("heading", { name: section.title });

expect(title).toBeVisible();
await expect(title).toBeVisible();

for (const item of section.links) {
const link = footer.getByRole("link", { name: item.name });

expect(link).toBeVisible();
await expect(link).toBeVisible();

const href = await link.getAttribute("href");
const target = await link.getAttribute("target");
Expand Down
2 changes: 1 addition & 1 deletion test/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test("navbar elements", async({ page, isMobile }) => {
const href = await link.getAttribute("href");
const target = await link.getAttribute("target");

expect(link).toBeVisible();
await expect(link).toBeVisible();

expect(href).toBe(item.href);
expect(target).toBe(item.external ? "_blank" : "_self");
Expand Down

0 comments on commit f6bb6cf

Please sign in to comment.