Improve e2e clipboard tests

Instead of trying to copy the RID of the first repo card, try to copy
the one you later expect.
This commit is contained in:
Sebastian Martinez
2024-12-05 14:48:43 +01:00
parent 653cf9a48d
commit ebc8b3236b
+2 -1
View File
@@ -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
@@ -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()",
);