feat: OOO booking-forwarding (#12653)
* feat-profile-forwarding * fix for promises of handling * fix badge success color * clean up * fix suggested changes * Changed design on booking-forward pages and moar test * taking care of suggested changes, trpc errors and code cleaning * improve text * fix conflicting data-testid * fix unique data-testid * fix error css-global, email button styles, error conditional * rename files to match functionality, remove away ui * Add translations and migration * remove log * small fixes + improvements * fix styles to match new design * merge fixes * Fix styles dark mode * Solving merge conflicts from earlier * Fix/change test to match new elements * use trash icon button insted of dots (design issues) * only send email if toUserId is set * Fix date picker dark mode * merge with remote * removed status field from table and email its now for notify * small text improvement in email * check for team plan not paid plan * fixes and clean up due to removing status * fix old send request name to new behaviour * more naming improvements and text * remove status from handle-type * code clean up * fix type error --------- Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
24 files changed
+1249
-62
No files matched your search
@@ -0,0 +1,101 @@
|
||||
import { expect } from "@playwright/test";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { randomString } from "@calcom/lib/random";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
import { test } from "./lib/fixtures";
|
||||
|
||||
test.describe.configure({ mode: "parallel" });
|
||||
test.afterEach(({ users }) => users.deleteAll());
|
||||
|
||||
test.describe("Out of office", () => {
|
||||
test("User can create out of office entry", async ({ page, users }) => {
|
||||
const user = await users.create({ name: "userOne" });
|
||||
|
||||
await user.apiLogin();
|
||||
|
||||
await page.goto("/settings/my-account/out-of-office");
|
||||
|
||||
await page.locator("data-testid=create-entry-ooo-redirect").click();
|
||||
|
||||
await expect(page.locator(`data-testid=table-redirect-n-a`)).toBeVisible();
|
||||
});
|
||||
|
||||
test("User can configure booking redirect", async ({ page, users }) => {
|
||||
const user = await users.create({ name: "userOne" });
|
||||
const userTo = await users.create({ name: "userTwo" });
|
||||
|
||||
const team = await prisma.team.create({
|
||||
data: {
|
||||
name: "test-insights",
|
||||
slug: `test-insights-${Date.now()}-${randomString(5)}}`,
|
||||
},
|
||||
});
|
||||
|
||||
// create memberships
|
||||
await prisma.membership.createMany({
|
||||
data: [
|
||||
{
|
||||
userId: user.id,
|
||||
teamId: team.id,
|
||||
accepted: true,
|
||||
role: "ADMIN",
|
||||
},
|
||||
{
|
||||
userId: userTo.id,
|
||||
teamId: team.id,
|
||||
accepted: true,
|
||||
role: "ADMIN",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
await user.apiLogin();
|
||||
|
||||
await page.goto(`/settings/my-account/out-of-office`);
|
||||
|
||||
await page.getByTestId("profile-redirect-switch").click();
|
||||
await page
|
||||
.getByTestId("team_username_select")
|
||||
.locator("div")
|
||||
.filter({ hasText: "Select team member" })
|
||||
.first()
|
||||
.click();
|
||||
await page.locator("#react-select-2-option-0 div").click();
|
||||
|
||||
// send request
|
||||
await page.getByTestId("create-entry-ooo-redirect").click();
|
||||
|
||||
// expect table-redirect-toUserId to be visible
|
||||
await expect(page.locator(`data-testid=table-redirect-${userTo.username}`)).toBeVisible();
|
||||
});
|
||||
|
||||
test("Profile redirection", async ({ page, users }) => {
|
||||
const user = await users.create({ name: "userOne" });
|
||||
const userTo = await users.create({ name: "userTwo" });
|
||||
const uuid = uuidv4();
|
||||
await prisma.outOfOfficeEntry.create({
|
||||
data: {
|
||||
start: dayjs().startOf("day").toDate(),
|
||||
end: dayjs().startOf("day").add(1, "w").toDate(),
|
||||
uuid,
|
||||
user: { connect: { id: user.id } },
|
||||
toUser: { connect: { id: userTo.id } },
|
||||
createdAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
await page.goto(`/${user.username}`);
|
||||
|
||||
await page.waitForLoadState("networkidle");
|
||||
|
||||
// regex to match username
|
||||
expect(page.url()).toMatch(new RegExp(`/${userTo.username}`));
|
||||
|
||||
await page.goto(`/${userTo.username}/30-min`);
|
||||
|
||||
expect(page.url()).toMatch(new RegExp(`/${userTo.username}/30-min`));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user