* use texteditor for bio * remove block types from about editor * add props to make editor height adjustable * set isDirty to true when about input is edited * add editor to getting-started * fix editor height * remove required error for onboarding * add helper function to check if parsed bio has text * add back commented code * fix onboarding tests for optional about field * rename function * parse team bio for read only members * code clean up * fix failing e2e because of missing test id * fix onboarding e2e test * add missing parse of user bio * Update apps/web/components/getting-started/steps-views/UserProfile.tsx * Update apps/web/pages/settings/my-account/profile.tsx Co-authored-by: Omar López <zomars@me.com> * use css inline style for height instead of tailwind class * fix height of editor-input * save bio as markdown in db * fix empty line when bio is empty * fix hydration failed error * Update packages/ui/components/editor/Editor.tsx Co-authored-by: Omar López <zomars@me.com> * remove unused import Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Omar López <zomars@me.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
71 lines
2.5 KiB
TypeScript
71 lines
2.5 KiB
TypeScript
/* eslint-disable playwright/no-skipped-test */
|
|
import { expect } from "@playwright/test";
|
|
|
|
import { test } from "./lib/fixtures";
|
|
|
|
test.describe.configure({ mode: "serial" });
|
|
|
|
test.describe("Onboarding", () => {
|
|
test.describe("Onboarding v2", () => {
|
|
test("Onboarding Flow", async ({ page, users }) => {
|
|
const user = await users.create({ completedOnboarding: false, name: null });
|
|
await user.login();
|
|
|
|
// tests whether the user makes it to /getting-started
|
|
// after login with completedOnboarding false
|
|
await page.waitForURL("/getting-started");
|
|
|
|
await test.step("step 1", async () => {
|
|
// Check required fields
|
|
await page.locator("button[type=submit]").click();
|
|
await expect(page.locator("data-testid=required")).toBeVisible();
|
|
|
|
// happy path
|
|
await page.locator("input[name=username]").fill("new user onboarding");
|
|
await page.locator("input[name=name]").fill("new user 2");
|
|
await page.locator("input[role=combobox]").click();
|
|
await page.locator("text=Eastern Time").click();
|
|
|
|
await page.locator("button[type=submit]").click();
|
|
|
|
// should be on step 2 now.
|
|
await expect(page).toHaveURL(/.*connected-calendar/);
|
|
|
|
const userComplete = await user.self();
|
|
expect(userComplete.name).toBe("new user 2");
|
|
});
|
|
|
|
await test.step("step 2", async () => {
|
|
const isDisabled = await page.locator("button[data-testid=save-calendar-button]").isDisabled();
|
|
await expect(isDisabled).toBe(true);
|
|
// tests skip button, we don't want to test entire flow.
|
|
await page.locator("button[data-testid=skip-step]").click();
|
|
|
|
await expect(page).toHaveURL(/.*setup-availability/);
|
|
});
|
|
|
|
await test.step("step 3", async () => {
|
|
const isDisabled = await page.locator("button[data-testid=save-availability]").isDisabled();
|
|
await expect(isDisabled).toBe(false);
|
|
// same here, skip this step.
|
|
await page.locator("button[data-testid=skip-step]").click();
|
|
|
|
await expect(page).toHaveURL(/.*user-profile/);
|
|
});
|
|
|
|
await test.step("step 4", async () => {
|
|
await page.locator("button[type=submit]").click();
|
|
|
|
// should redirect to /event-types after onboarding
|
|
await page.waitForURL("/event-types");
|
|
|
|
const userComplete = await user.self();
|
|
|
|
const userCompleteBio = userComplete.bio ? userComplete.bio : "";
|
|
|
|
expect(userCompleteBio.replace("<p><br></p>", "").length).toBe(0);
|
|
});
|
|
});
|
|
});
|
|
});
|