Skip to content

Commit

Permalink
Fix e2e test
Browse files Browse the repository at this point in the history
RISDEV-5721
  • Loading branch information
leonie-koch committed Dec 31, 2024
1 parent d73ee4b commit 762821a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,7 @@ test.describe("short and long texts", () => {
)

await expect(page.getByText(testId, { exact: true })).toBeVisible()
await expect(
page.getByText(value, {
exact: true,
}),
).toBeVisible()
await expect(page.getByText(value)).toBeVisible()
})
}

Expand Down
5 changes: 4 additions & 1 deletion frontend/test/e2e/caselaw/e2e-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,10 @@ export async function getRequest(url: string, page: Page): Promise<Request> {
export async function clickCategoryButton(testId: string, page: Page) {
await test.step(`click '${testId}' button to open category`, async () => {
const button = page.getByRole("button", { name: testId, exact: true })
await button.click()

if (await button.isVisible()) {
await button.click()
}
await expect(page.getByTestId(testId)).toBeVisible()
})
}
Expand Down

0 comments on commit 762821a

Please sign in to comment.