fix e2e tests (#5726)
* fix e2e tests * remove not needed waitForNavigation Co-authored-by: CarinaWolli <wollencarina@gmail.com>
This commit is contained in:
co-authored by
CarinaWolli
parent
2ce2c1074b
commit
9a12b5a0ac
@@ -361,7 +361,7 @@ export default function Success(props: SuccessProps) {
|
||||
<div className="mt-6 mb-8 text-center last:mb-0">
|
||||
<h3
|
||||
className="text-2xl font-semibold leading-6 text-neutral-900 dark:text-white"
|
||||
data-testid="success-headline"
|
||||
data-testid={isCancelled ? "cancelled-headline" : ""}
|
||||
id="modal-headline">
|
||||
{needsConfirmation && !isCancelled
|
||||
? props.recurringBookings
|
||||
|
||||
@@ -114,14 +114,9 @@ test.describe("pro user", () => {
|
||||
// --- fill form
|
||||
await page.locator('[data-testid="cancel"]').click();
|
||||
|
||||
await page.waitForNavigation({
|
||||
url: (url) => {
|
||||
return url.pathname.startsWith("/success");
|
||||
},
|
||||
});
|
||||
const successHeadling = await page.locator('[data-testid="success-headline"]').innerText();
|
||||
const cancelledHeadline = await page.locator('[data-testid="cancelled-headline"]').innerText();
|
||||
|
||||
await expect(successHeadling).toBe("This event is cancelled");
|
||||
await expect(cancelledHeadline).toBe("This event is cancelled");
|
||||
|
||||
await page.goto(`/${pro.username}`);
|
||||
await bookFirstEvent(page);
|
||||
|
||||
@@ -54,14 +54,9 @@ test("dynamic booking", async ({ page, users }) => {
|
||||
// --- fill form
|
||||
await page.locator('[data-testid="cancel"]').click();
|
||||
|
||||
await page.waitForNavigation({
|
||||
url: (url) => {
|
||||
return url.pathname.startsWith("/success");
|
||||
},
|
||||
});
|
||||
const successHeadling = await page.locator('[data-testid="success-headline"]').innerText();
|
||||
const cancelledHeadline = await page.locator('[data-testid="cancelled-headline"]').innerText();
|
||||
|
||||
await expect(successHeadling).toBe("This event is cancelled");
|
||||
await expect(cancelledHeadline).toBe("This event is cancelled");
|
||||
});
|
||||
|
||||
await users.deleteAll();
|
||||
|
||||
Reference in New Issue
Block a user