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 <peeroke@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Alex van Andel 2022-10-05 12:55:11 +01:00 committed by GitHub
parent 246fce3ab8
commit f49783b453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

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}` : ""}`}>

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];