Skip to content

Commit 7801266

Browse files
fix: remove TeamsCTA from teams loading skeleton (calcom#28323)
* fix: resolve duplicate new-team-btn selector in teams E2E test Remove TeamsCTA from the loading skeleton to prevent duplicate data-testid='new-team-btn' elements in the DOM during Next.js streaming SSR. The skeleton's Suspense fallback and the resolved page content can briefly coexist, causing Playwright's strict mode to fail when both contain the same test ID. Also use .first() in the E2E test as a defensive measure. Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com> * fix: assert single new-team-btn element instead of using .first() Address Cubic AI review feedback: use toHaveCount(1) assertion to ensure exactly one new-team-btn exists, rather than .first() which could mask duplicate-element regressions. Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com> * fix: revert test changes, only remove CTA from skeleton Per user feedback: only change needed is removing TeamsCTA from the loading skeleton to prevent users without a team plan from bypassing the upgrade banner via the skeleton CTA. Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent cfb1489 commit 7801266

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

apps/web/app/(use-page-wrapper)/(main-nav)/teams/skeleton.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
"use client";
22

3-
import { ShellMainAppDir } from "app/(use-page-wrapper)/(main-nav)/ShellMainAppDir";
4-
import { TeamsCTA } from "app/(use-page-wrapper)/(main-nav)/teams/CTA";
5-
63
import { useLocale } from "@calcom/lib/hooks/useLocale";
7-
4+
import { ShellMainAppDir } from "app/(use-page-wrapper)/(main-nav)/ShellMainAppDir";
85
import SkeletonLoaderTeamList from "~/ee/teams/components/SkeletonloaderTeamList";
96

107
export const TeamsListSkeleton = () => {
118
const { t } = useLocale();
129
return (
13-
<ShellMainAppDir
14-
heading={t("teams")}
15-
subtitle={t("create_manage_teams_collaborative")}
16-
CTA={<TeamsCTA />}>
10+
<ShellMainAppDir heading={t("teams")} subtitle={t("create_manage_teams_collaborative")}>
1711
<SkeletonLoaderTeamList />
1812
</ShellMainAppDir>
1913
);

apps/web/playwright/teams.e2e.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { expect } from "@playwright/test";
2-
31
import { IS_TEAM_BILLING_ENABLED } from "@calcom/lib/constants";
42
import { prisma } from "@calcom/prisma";
53
import { SchedulingType } from "@calcom/prisma/enums";
6-
4+
import { expect } from "@playwright/test";
75
import { test, todo } from "./lib/fixtures";
86
import {
97
bookTimeSlot,
@@ -175,7 +173,6 @@ test.describe("Teams - NonOrg", () => {
175173
await page.goto("/teams");
176174

177175
await test.step("Can create team with same name", async () => {
178-
// Click the new team button
179176
await page.locator("[data-testid=new-team-btn]").click();
180177
await page.waitForLoadState("networkidle");
181178
// Fill team name input (new onboarding-v3 style flow)

0 commit comments

Comments
 (0)