From ebc8b3236b2d8414ff3754cee69bbea5be8b2787 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Thu, 5 Dec 2024 14:48:43 +0100 Subject: [PATCH] Improve e2e clipboard tests Instead of trying to copy the RID of the first repo card, try to copy the one you later expect. --- tests/e2e/clipboard.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/clipboard.spec.ts b/tests/e2e/clipboard.spec.ts index 3828beca6..ad295b267 100644 --- a/tests/e2e/clipboard.spec.ts +++ b/tests/e2e/clipboard.spec.ts @@ -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( "navigator.clipboard.readText()", );