Skip to content

Scheduling infrastructure for absolutely everyone.

chore: [app-router-migration-7] Migrate `/teams` page (#12622)

Benny Joof201266d69ff
diff --git a/.env.example b/.env.example
index e15bdefcd9c..3b7cf159e6d 100644
--- a/.env.example
+++ b/.env.example
@@ -327,6 +327,7 @@ APP_ROUTER_SETTINGS_TEAMS_ENABLED=0
APP_ROUTER_GETTING_STARTED_STEP_ENABLED=0
APP_ROUTER_APPS_ENABLED=0
APP_ROUTER_VIDEO_ENABLED=0
+APP_ROUTER_TEAMS_ENABLED=0
# disable setry server source maps
-SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN=1
\ No newline at end of file
+SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN=1
diff --git a/apps/web/abTest/middlewareFactory.ts b/apps/web/abTest/middlewareFactory.ts
index 7c2cf36832a..ef5c93ebc79 100644
--- a/apps/web/abTest/middlewareFactory.ts
+++ b/apps/web/abTest/middlewareFactory.ts
@@ -17,6 +17,7 @@ const ROUTES: [URLPattern, boolean][] = [
["/apps", process.env.APP_ROUTER_APPS_ENABLED === "1"] as const,
["/bookings/:status", process.env.APP_ROUTER_BOOKINGS_STATUS_ENABLED === "1"] as const,
["/video/:path*", process.env.APP_ROUTER_VIDEO_ENABLED === "1"] as const,
+ ["/teams", process.env.APP_ROUTER_TEAMS_ENABLED === "1"] as const,
].map(([pathname, enabled]) => [
new URLPattern({
pathname,
diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts
index c2025b14d70..213869dbfa2 100644
--- a/apps/web/middleware.ts
+++ b/apps/web/middleware.ts
@@ -142,6 +142,8 @@ export const config = {
"/future/bookings/:status/",
"/video/:path*",
"/future/video/:path*",
+ "/teams",
+ "/future/teams/",
],
};
diff --git a/apps/web/playwright/teams.e2e.ts b/apps/web/playwright/teams.e2e.ts
index 0491241e0b6..51f1976a439 100644
--- a/apps/web/playwright/teams.e2e.ts
+++ b/apps/web/playwright/teams.e2e.ts
@@ -17,6 +17,35 @@ import {
test.describe.configure({ mode: "parallel" });
+test.describe("Teams A/B tests", () => {
+ test("should point to the /future/teams page", async ({ page, users, context }) => {
+ await context.addCookies([
+ {
+ name: "x-calcom-future-routes-override",
+ value: "1",
+ url: "http://localhost:3000",
+ },
+ ]);
+ const user = await users.create();
+
+ await user.apiLogin();
+
+ await page.goto("/teams");
+
+ await page.waitForLoadState();
+
+ const dataNextJsRouter = await page.evaluate(() =>
+ window.document.documentElement.getAttribute("data-nextjs-router")
+ );
+
+ expect(dataNextJsRouter).toEqual("app");
+
+ const locator = page.getByRole("heading", { name: "teams" });
+
+ await expect(locator).toBeVisible();
+ });
+});
+
test.describe("Teams - NonOrg", () => {
test.afterEach(({ users }) => users.deleteAll());
diff --git a/turbo.json b/turbo.json
index e7f02741413..dfd687535db 100644
--- a/turbo.json
+++ b/turbo.json
@@ -211,6 +211,7 @@
"APP_ROUTER_SETTINGS_TEAMS_ENABLED",
"APP_ROUTER_WORKFLOWS_ENABLED",
"APP_ROUTER_VIDEO_ENABLED",
+ "APP_ROUTER_TEAMS_ENABLED",
"APP_USER_NAME",
"BASECAMP3_CLIENT_ID",
"BASECAMP3_CLIENT_SECRET",