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 <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2022-10-05 11:55:11 +00:00
1 parent 246fce3ab8
commit f49783b453
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ const Item = ({ type, group, readOnly }: { type: EventType; group: EventTypeGrou
const { t } = useLocale();
return (
<Link href={`/event-types/${type.id}`}>
<Link href={`/event-types/${type.id}?tabName=setup`}>
<a
className="flex-grow truncate text-sm"
title={`${type.title} ${type.description ? `– ${type.description}` : ""}`}>
+3 -1
View File
@@ -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];