feat: make the meeting duration time more visually toggleable (#15422)

* feat: make the meeting duration time more visually toggleable

* final_update

* Update dynamic-booking-pages.e2e.ts

* fix e2e

* fix: e2e test

* fixed

* update

* show selcted item at the time of mount

* fix type error

* Update Duration.tsx

* fix

---------

Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-08-19 14:25:02 +00:00
1 parent 99b7aaa62d
commit 680e748b7a
7 files changed
+97 -35

No files matched your search

@@ -145,7 +145,7 @@ async function getDynamicGroupPageProps(context: GetServerSidePropsContext) {
length: eventData.length,
metadata: {
...eventData.metadata,
multipleDuration: [15, 30, 60],
multipleDuration: [15, 30, 45, 60, 90],
},
},
user: usernames.join("+"),
@@ -72,23 +72,23 @@ test("dynamic booking info prefilled by query params", async ({ page, users }) =
await page.waitForLoadState("networkidle");
const badgeByDurationTestId = (duration: number) => `multiple-choice-${duration}mins`;
const listItemByDurationTestId = (duration: number) => `multiple-choice-${duration}mins`;
let badgeLocator = await page.getByTestId(badgeByDurationTestId(duration));
let activeState = await badgeLocator.getAttribute("data-active");
let listItemLocator = await page.getByTestId(listItemByDurationTestId(duration));
let activeState = await listItemLocator.getAttribute("data-active");
expect(activeState).toEqual("true");
duration = 30;
await page.goto(`/${pro.username}+${free.username}?duration=${duration}`);
badgeLocator = await page.getByTestId(badgeByDurationTestId(duration));
activeState = await badgeLocator.getAttribute("data-active");
listItemLocator = await page.getByTestId(listItemByDurationTestId(duration));
activeState = await listItemLocator.getAttribute("data-active");
expect(activeState).toEqual("true");
// Check another badge just to ensure its not selected
badgeLocator = await page.getByTestId(badgeByDurationTestId(15));
activeState = await badgeLocator.getAttribute("data-active");
listItemLocator = await page.getByTestId(listItemByDurationTestId(15));
activeState = await listItemLocator.getAttribute("data-active");
expect(activeState).toEqual("false");
});
// eslint-disable-next-line playwright/no-skipped-test
+1
View File
@@ -64,6 +64,7 @@ testBothFutureAndLegacyRoutes.describe("Event Types tests", () => {
const nonce = randomString(3);
const eventTitle = `my recurring event ${nonce}`;
await createNewEventType(page, { eventTitle });
await page.waitForLoadState("networkidle");
await page.click("[data-testid=vertical-tab-recurring]");
await expect(page.locator("[data-testid=recurring-event-collapsible]")).toBeHidden();
@@ -713,6 +713,7 @@
"default_duration_no_options": "Please choose available durations first",
"multiple_duration_mins": "{{count}} $t(minute_timeUnit)",
"multiple_duration_timeUnit": "{{count}} $t({{unit}}_timeUnit)",
"multiple_duration_timeUnit_short": "{{count}}$t({{unit}}_short)",
"minutes": "Minutes",
"use_cal_ai_to_make_call_description": "Use Cal.ai to get an AI powered phone number or make calls to guests.",
"round_robin": "Round Robin",
@@ -1224,6 +1225,8 @@
"day_timeUnit": "days",
"hour_timeUnit": "hours",
"minute_timeUnit": "mins",
"minute_short": "m",
"hour_short": "h",
"new_workflow_heading": "Create your first workflow",
"new_workflow_description": "Workflows enable you to automate sending reminders and notifications.",
"active_on": "Active on",
@@ -1277,8 +1280,10 @@
"reminder_email": "Reminder: {{eventType}} with {{name}} at {{date}}",
"not_triggering_existing_bookings": "Won't trigger for already existing bookings as user will be asked for phone number when booking the event.",
"minute_one": "{{count}} minute",
"minute_one_short": "{{count}}m",
"minute_other": "{{count}} minutes",
"hour_one": "{{count}} hour",
"hour_one_short": "{{count}}h",
"hour_other": "{{count}} hours",
"invalid_input": "Invalid input",
"broken_video_action": "We could not add the <1>{{location}}</1> meeting link to your scheduled event. Contact your invitees or update your calendar event to add the details. You can either <3> change your location on the event type </3> or try <5>removing and adding the app again.</5>",