feat: redesign team creation flow to match onboarding-v3 design (#26733)

* feat: redesign team creation flow to match onboarding-v3 design

Co-Authored-By: [email protected] <[email protected]>

* feat: skip invite options and go directly to email invite step

Co-Authored-By: [email protected] <[email protected]>

* feat: invalidate teams query on submit to refresh teams list

Co-Authored-By: [email protected] <[email protected]>

* fix: use server action to invalidate server-side teams cache

Co-Authored-By: [email protected] <[email protected]>

* fix: conditionally render avatar in browser view to remove extra padding

Co-Authored-By: [email protected] <[email protected]>

* fix browser view

* test: update team creation E2E tests to use new onboarding-v3 flow

Co-Authored-By: [email protected] <[email protected]>

* test: update auth-index.e2e.ts to use new team creation flow

Co-Authored-By: [email protected] <[email protected]>

* test: update team-management.e2e.ts to use new team creation flow

Co-Authored-By: [email protected] <[email protected]>

* fix: add error handling for createTeam and improve CSV parsing for quoted fields

Co-Authored-By: [email protected] <[email protected]>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-01-19 14:53:51 +00:00
1 parent a8abe2cdf1
commit 37847c0061
13 files changed
+997 -139

No files matched your search

+9 -7
View File
@@ -26,16 +26,18 @@ test.describe("Can signup from a team invite", async () => {
await page.goto("/settings/teams/new");
await page.waitForLoadState("networkidle");
// Create a new team
await page.locator('input[name="name"]').fill(teamName);
await page.locator('input[name="slug"]').fill(teamName);
// Create a new team (new onboarding-v3 style flow)
await page.locator('[data-testid="team-name-input"]').fill(teamName);
await page.locator('button[type="submit"]').click();
// Add new member to team
await page.click('[data-testid="new-member-button"]');
await page.fill('input[id="inviteUser"]', testUser.email);
// Wait for the invite email page
await page.waitForURL(/\/settings\/teams\/new\/invite\/email.*$/i);
await page.waitForLoadState("networkidle");
// Add new member to team via email invite form
await page.locator('input[type="email"]').first().fill(testUser.email);
const submitPromise = page.waitForResponse("/api/trpc/teams/inviteMember?batch=1");
await page.getByTestId("invite-new-member-button").click();
await page.locator('button[type="submit"]').click();
const response = await submitPromise;
expect(response.status()).toBe(200);
@@ -29,51 +29,30 @@ test.describe("Teams", () => {
// Click text=Create Team
await page.locator("text=Create a new Team").click();
await page.waitForLoadState("networkidle");
// Fill input[name="name"]
await page.locator('input[name="name"]').fill(`${user.username}'s Team`);
// Fill team name input (new onboarding-v3 style flow)
await page.locator('[data-testid="team-name-input"]').fill(`${user.username}'s Team`);
// Click text=Continue
await page.click("[type=submit]");
// TODO: Figure out a way to make this more reliable
// eslint-disable-next-line playwright/no-conditional-in-test
if (IS_TEAM_BILLING_ENABLED) await fillStripeTestCheckout(page);
await expect(page).toHaveURL(/\/settings\/teams\/(\d+)\/onboard-members.*$/i);
await page.waitForSelector('[data-testid="pending-member-list"]');
await expect(page.getByTestId("pending-member-item")).toHaveCount(1);
// Wait for the invite email page (new flow)
await expect(page).toHaveURL(/\/settings\/teams\/new\/invite\/email.*$/i);
await page.waitForLoadState("networkidle");
});
await test.step("Can add members", async () => {
await page.getByTestId("new-member-button").click();
await page.locator('[placeholder="email\\@example\\.com"]').fill(inviteeEmail);
await page.getByTestId("invite-new-member-button").click();
await expect(page.getByTestId("pending-member-item").filter({ hasText: inviteeEmail })).toBeVisible();
// locator.count() does not await for the expected number of elements
// https://github.com/microsoft/playwright/issues/14278
// using toHaveCount() is more reliable
await expect(page.getByTestId("pending-member-item")).toHaveCount(2);
await test.step("Can add members via email invite", async () => {
// Add member via email invite form
await page.locator('input[type="email"]').first().fill(inviteeEmail);
await page.click("[type=submit]");
await page.waitForLoadState("networkidle");
// Wait for redirect to teams page
await expect(page).toHaveURL(/\/teams$/i);
});
await test.step("Can remove members", async () => {
await expect(page.getByTestId("pending-member-item")).toHaveCount(2);
const lastRemoveMemberButton = page.getByTestId("remove-member-button").last();
await lastRemoveMemberButton.click();
await expect(page.getByTestId("pending-member-item")).toHaveCount(1);
// Cleanup here since this user is created without our fixtures.
await prisma.user.delete({ where: { email: inviteeEmail } });
});
await test.step("Can finish team invitation", async () => {
await page.getByTestId("publish-button").click();
await expect(page).toHaveURL(/\/settings\/teams\/(\d+)\/event-type$/i);
});
await test.step("Can finish team creation", async () => {
const locator = page.locator('div:has(input[value="ROUND_ROBIN"]) > button');
await expect(locator).toBeVisible();
await locator.click();
await page.fill("[name=title]", "roundRobin");
await page.getByTestId("finish-button").click();
await test.step("Can navigate to team settings", async () => {
// Click on the team to go to settings
await page.locator(`text=${user.username}'s Team`).click();
await page.waitForURL(/\/settings\/teams\/(\d+)\/profile$/i);
});
@@ -82,6 +61,13 @@ test.describe("Teams", () => {
await page.getByTestId("dialog-confirmation").click();
await page.waitForURL("/teams");
expect(await page.locator(`text=${user.username}'s Team`).count()).toEqual(0);
// Cleanup the invited user since they were created without our fixtures
const invitedUser = await prisma.user.findUnique({ where: { email: inviteeEmail } });
// eslint-disable-next-line playwright/no-conditional-in-test
if (invitedUser) {
await prisma.user.delete({ where: { email: inviteeEmail } });
}
});
});
});
+14 -14
View File
@@ -139,11 +139,11 @@ test.describe("Teams - NonOrg", () => {
const uniqueName = "test-unique-team-name";
// Go directly to the create team page
// Go directly to the create team page (new onboarding-v3 style flow)
await page.goto("/settings/teams/new");
await page.waitForLoadState("networkidle");
// Fill input[name="name"]
await page.locator('input[name="name"]').fill(uniqueName);
// Fill team name input
await page.locator('[data-testid="team-name-input"]').fill(uniqueName);
await page.click("[type=submit]");
// cleanup
@@ -163,22 +163,22 @@ test.describe("Teams - NonOrg", () => {
// Click text=Create Team
await page.locator("text=Create Team").click();
await page.waitForLoadState("networkidle");
// Fill input[name="name"]
await page.locator('input[name="name"]').fill(uniqueName);
// Click text=Continue
// Fill team name input (new onboarding-v3 style flow)
await page.locator('[data-testid="team-name-input"]').fill(uniqueName);
// Click Continue
await page.click("[type=submit]");
// TODO: Figure out a way to make this more reliable
// eslint-disable-next-line playwright/no-conditional-in-test
if (IS_TEAM_BILLING_ENABLED) await fillStripeTestCheckout(page);
await page.waitForURL(/\/settings\/teams\/(\d+)\/onboard-members.*$/i);
// Wait for the page to fully load and the publish button to be visible
// Wait for the invite email page
await page.waitForURL(/\/settings\/teams\/new\/invite\/email.*$/i);
await page.waitForLoadState("networkidle");
const publishButton = page.locator("[data-testid=publish-button]");
await publishButton.waitFor({ state: "visible", timeout: 10000 });
await publishButton.click();
await page.waitForURL(/\/settings\/teams\/(\d+)\/event-type*$/i);
await page.locator("[data-testid=handle-later-button]").click();
await page.waitForURL(/\/settings\/teams\/(\d+)\/profile$/i);
// Skip the invite step
const skipButton = page.locator("[data-testid=skip-invite-button]");
await skipButton.waitFor({ state: "visible", timeout: 10000 });
await skipButton.click();
// Wait for redirect to teams page
await page.waitForURL(/\/teams$/i);
});
await test.step("Can access user and team with same slug", async () => {