From f49783b453af6f384d67b7f8681402d143be54e1 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Wed, 5 Oct 2022 12:55:11 +0100 Subject: [PATCH] Bugfix/reinstate tab name with fixed test (#4842) * added ?tabName=setup to event-type detail link to give it active status (#4830) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * Use pathname instead of href directly Co-authored-by: Peer Richelsen Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/web/pages/v2/event-types/index.tsx | 2 +- apps/web/playwright/event-types.e2e.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/pages/v2/event-types/index.tsx b/apps/web/pages/v2/event-types/index.tsx index 8432c4feeb..979c14e60b 100644 --- a/apps/web/pages/v2/event-types/index.tsx +++ b/apps/web/pages/v2/event-types/index.tsx @@ -52,7 +52,7 @@ const Item = ({ type, group, readOnly }: { type: EventType; group: EventTypeGrou const { t } = useLocale(); return ( - + diff --git a/apps/web/playwright/event-types.e2e.ts b/apps/web/playwright/event-types.e2e.ts index e2af0f525c..341797ed0d 100644 --- a/apps/web/playwright/event-types.e2e.ts +++ b/apps/web/playwright/event-types.e2e.ts @@ -1,5 +1,7 @@ import { expect } from "@playwright/test"; +import { WEBAPP_URL } from "@calcom/lib/constants"; + import { randomString } from "../lib/random"; import { test } from "./lib/fixtures"; @@ -87,7 +89,7 @@ test.describe("Event Types tests", () => { ); const href = await firstElement.getAttribute("href"); if (!href) throw new Error("No href found for event type"); - const [eventTypeId] = href.split("/").reverse(); + const [eventTypeId] = new URL(WEBAPP_URL + href).pathname.split("/").reverse(); const firstTitle = await page.locator(`[data-testid=event-type-title-${eventTypeId}]`).innerText(); const firstFullSlug = await page.locator(`[data-testid=event-type-slug-${eventTypeId}]`).innerText(); const firstSlug = firstFullSlug.split("/")[2];