Skip to content

Commit

Permalink
Improve e2e clipboard tests
Browse files Browse the repository at this point in the history
Instead of trying to copy the RID of the first repo card, try to copy
the one you later expect.
  • Loading branch information
sebastinez committed Dec 5, 2024
1 parent 653cf9a commit ebc8b32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/e2e/clipboard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { chromium } from "playwright";

import { expect, markdownRid, test } from "@tests/support/fixtures.js";
import { formatRepositoryId } from "@app/lib/utils";

// We explicitly run all clipboard tests withing the context of a single test
// so that we don't run into race conditions, because there is no way to isolate
Expand All @@ -18,7 +19,7 @@ test("copy to clipboard", async () => {

// Repo ID.
{
await page.getByLabel("repo-id").first().click();
await page.getByText(formatRepositoryId(markdownRid)).click();
const clipboardContent = await page.evaluate<string>(
"navigator.clipboard.readText()",
);
Expand Down

0 comments on commit ebc8b32

Please sign in to comment.