From c181e8f0c64b4e0a333191e510952cc6b13fe08f Mon Sep 17 00:00:00 2001 From: bilalabbad Date: Thu, 31 Oct 2024 11:02:02 +0100 Subject: [PATCH] improve test --- frontend/app/tests/e2e/branches.spec.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/app/tests/e2e/branches.spec.ts b/frontend/app/tests/e2e/branches.spec.ts index 42c1215ed2..11cc16836e 100644 --- a/frontend/app/tests/e2e/branches.spec.ts +++ b/frontend/app/tests/e2e/branches.spec.ts @@ -18,13 +18,18 @@ test.describe("Branches creation and deletion", () => { await expect(page.getByTestId("create-branch-button")).toBeDisabled(); }); - test("should not see the quick action to create a not found branch name", async ({ page }) => { + test("should not show quick-create option when searching for non-existent branch", async ({ + page, + }) => { await page.goto("/"); await page.getByTestId("branch-selector-trigger").click(); - await page.getByTestId("branch-search-input").fill("not-found-branch"); + + const nonExistentBranchName = "non-existent-branch-123"; + await page.getByTestId("branch-search-input").fill(nonExistentBranchName); + await expect(page.getByText("No branch found")).toBeVisible(); await expect( - page.getByRole("option", { name: "Create branch not-found-branch" }) + page.getByRole("option", { name: `Create branch ${nonExistentBranchName}` }) ).not.toBeVisible(); }); });