Scheduling infrastructure for absolutely everyone.
Add test for different layouts (#11091)
alannnceea705922684
diff --git a/apps/web/playwright/booking-pages.e2e.ts b/apps/web/playwright/booking-pages.e2e.tsindex 3ca81bc2c77..9ebd29bb2d9 100644--- a/apps/web/playwright/booking-pages.e2e.ts+++ b/apps/web/playwright/booking-pages.e2e.ts@@ -268,3 +268,60 @@ test.describe("prefill", () => {});});});++test.describe("Booking on different layouts", () => {+ test.beforeEach(async ({ page, users }) => {+ const user = await users.create();+ await page.goto(`/${user.username}`);+ });++ test("Book on week layout", async ({ page }) => {+ // Click first event type+ await page.click('[data-testid="event-type-link"]');++ await page.click('[data-testid="toggle-group-item-week_view"]');++ await page.click('[data-testid="incrementMonth"]');++ await page.locator('[data-testid="calendar-empty-cell"]').nth(0).click();++ // Fill what is this meeting about? name email and notes+ await page.locator('[name="name"]').fill("Test name");+ await page.locator('[name="email"]').fill(`${randomString(4)}@example.com`);+ await page.locator('[name="notes"]').fill("Test notes");++ await page.click('[data-testid="confirm-book-button"]');++ await page.waitForURL((url) => {+ return url.pathname.startsWith("/booking");+ });++ // expect page to be booking page+ await expect(page.locator("[data-testid=success-page]")).toBeVisible();+ });++ test("Book on column layout", async ({ page }) => {+ // Click first event type+ await page.click('[data-testid="event-type-link"]');++ await page.click('[data-testid="toggle-group-item-column_view"]');++ await page.click('[data-testid="incrementMonth"]');++ await page.locator('[data-testid="time"]').nth(0).click();++ // Fill what is this meeting about? name email and notes+ await page.locator('[name="name"]').fill("Test name");+ await page.locator('[name="email"]').fill(`${randomString(4)}@example.com`);+ await page.locator('[name="notes"]').fill("Test notes");++ await page.click('[data-testid="confirm-book-button"]');++ await page.waitForURL((url) => {+ return url.pathname.startsWith("/booking");+ });++ // expect page to be booking page+ await expect(page.locator("[data-testid=success-page]")).toBeVisible();+ });+});diff --git a/packages/features/calendars/weeklyview/components/event/Empty.tsx b/packages/features/calendars/weeklyview/components/event/Empty.tsxindex cc93b959c0a..386bc7d6ebb 100644--- a/packages/features/calendars/weeklyview/components/event/Empty.tsx+++ b/packages/features/calendars/weeklyview/components/event/Empty.tsx@@ -96,6 +96,7 @@ function Cell({ isDisabled, topOffsetMinutes, timeSlot }: CellProps) {)}data-disabled={isDisabled}data-slot={timeSlot.toISOString()}+ data-testid="calendar-empty-cell"style={{height: `calc(${hoverEventDuration}*var(--one-minute-height))`,overflow: "visible",diff --git a/packages/ui/components/form/toggleGroup/ToggleGroup.tsx b/packages/ui/components/form/toggleGroup/ToggleGroup.tsxindex 5df1d7e6167..1247830d408 100644--- a/packages/ui/components/form/toggleGroup/ToggleGroup.tsx+++ b/packages/ui/components/form/toggleGroup/ToggleGroup.tsx@@ -49,6 +49,7 @@ export const ToggleGroup = ({ options, onValueChange, isFullWidth, ...props }: T<RadixToggleGroup.Itemdisabled={option.disabled}value={option.value}+ data-testid={`toggle-group-item-${option.value}`}className={classNames("aria-checked:bg-emphasis relative rounded-[4px] px-3 py-1 text-sm leading-tight transition-colors",option.disabled