perf: Create 'heavy' eventTypes router (#23664)
* perf: Create 'heavy' eventTypes router * Fixing type checks * Fixing platform libraries imports
This commit is contained in:
1 parent
411a14dd3d
commit
86dcd6f0ff
33 files changed
+107
-75
No files matched your search
@@ -113,7 +113,7 @@ test("multiple duration selection updates event length correctly", async ({ page
|
||||
await page.getByTestId("vertical-tab-event_advanced_tab_title").click();
|
||||
await page.fill('[name="eventName"]', "{Event duration} event btwn {Organiser} {Scheduler}");
|
||||
await page.locator('[data-testid="update-eventtype"]').click();
|
||||
await page.waitForResponse("/api/trpc/eventTypes/update?batch=1");
|
||||
await page.waitForResponse("/api/trpc/eventTypes/heavy/update?batch=1");
|
||||
});
|
||||
|
||||
await page.goto(`/${user.username}/multiple-duration`);
|
||||
|
||||
@@ -131,7 +131,7 @@ test.describe("Event Types tests", () => {
|
||||
expect(formTitle).toBe(firstTitle);
|
||||
expect(formSlug).toContain(firstSlug);
|
||||
|
||||
const submitPromise = page.waitForResponse("/api/trpc/eventTypes/duplicate?batch=1");
|
||||
const submitPromise = page.waitForResponse("/api/trpc/eventTypes/heavy/duplicate?batch=1");
|
||||
await page.getByTestId("continue").click();
|
||||
const response = await submitPromise;
|
||||
expect(response.status()).toBe(200);
|
||||
@@ -144,7 +144,7 @@ test.describe("Event Types tests", () => {
|
||||
await page.waitForURL((url) => {
|
||||
return !!url.pathname.match(/\/event-types\/.+/);
|
||||
});
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
});
|
||||
@@ -167,7 +167,7 @@ test.describe("Event Types tests", () => {
|
||||
await page.locator("[data-testid=add-location]").click();
|
||||
await fillLocation(page, locationData[2], 2);
|
||||
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
|
||||
@@ -314,7 +314,7 @@ test.describe("Event Types tests", () => {
|
||||
const locationAddress = "New Delhi";
|
||||
|
||||
await fillLocation(page, locationAddress, 0, false);
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
|
||||
@@ -429,7 +429,7 @@ test.describe("Event Types tests", () => {
|
||||
await page.locator('[aria-label="Timezone Select"]').fill("New York");
|
||||
await page.keyboard.press("Enter");
|
||||
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
await page.goto("/event-types");
|
||||
|
||||
@@ -50,7 +50,7 @@ export function createBookingPageFixture(page: Page) {
|
||||
await page.goto("/event-types");
|
||||
},
|
||||
updateEventType: async () => {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
},
|
||||
|
||||
@@ -42,7 +42,7 @@ test.describe("private links creation and usage", () => {
|
||||
const $url = await page.locator('[data-testid="private-link-url"]').inputValue();
|
||||
|
||||
// click update
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
// book using generated url hash
|
||||
@@ -74,7 +74,7 @@ test.describe("private links creation and usage", () => {
|
||||
await page.locator("[data-testid=event-slug]").first().fill("somethingrandom");
|
||||
await expect(page.locator('[data-testid="event-slug"]').first()).toHaveValue("somethingrandom");
|
||||
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
await page.locator("[data-testid=vertical-tab-event_advanced_tab_title]").click();
|
||||
@@ -113,7 +113,7 @@ test.describe("private links creation and usage", () => {
|
||||
await page.locator('[data-testid="private-link-expiration-settings-save"]').click();
|
||||
await page.waitForLoadState("networkidle");
|
||||
// click update
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
// book using generated url hash
|
||||
@@ -164,7 +164,7 @@ test.describe("private links creation and usage", () => {
|
||||
await page.locator('[data-testid="private-link-expiration-settings-save"]').click();
|
||||
await page.waitForLoadState("networkidle");
|
||||
// click update
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
// book using generated url hash
|
||||
|
||||
@@ -476,7 +476,7 @@ export async function gotoBookingPage(page: Page) {
|
||||
}
|
||||
|
||||
export async function saveEventType(page: Page) {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ async function openBookingFormInPreviewTab(context: PlaywrightTestArgs["context"
|
||||
}
|
||||
|
||||
async function saveEventType(page: Page) {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -239,5 +239,5 @@ async function gotoBookingPage(page: Page) {
|
||||
}
|
||||
|
||||
async function saveAndWaitForResponse(page: Page) {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1");
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1");
|
||||
}
|
||||
@@ -407,7 +407,7 @@ test.describe("Bookings", () => {
|
||||
await page.goto(`/event-types/${teamEvent.id}?tabName=advanced`);
|
||||
await page.getByTestId("requires-confirmation").click();
|
||||
await page.getByTestId("update-eventtype").click();
|
||||
await page.waitForResponse((response) => response.url().includes("/api/trpc/eventTypes/update"));
|
||||
await page.waitForResponse((response) => response.url().includes("/api/trpc/eventTypes/heavy/update"));
|
||||
|
||||
await doOnOrgDomain(
|
||||
{
|
||||
@@ -783,7 +783,7 @@ const markPhoneNumberAsRequiredAndEmailAsOptional = async (page: Page, eventId:
|
||||
const emailRequiredFiled = await page.locator('[data-testid="field-required"]').first();
|
||||
await emailRequiredFiled.click();
|
||||
await page.getByTestId("field-add-save").click();
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
};
|
||||
@@ -797,7 +797,7 @@ const markPhoneNumberAsRequiredField = async (page: Page, eventId: number) => {
|
||||
const phoneRequiredFiled = await page.locator('[data-testid="field-required"]').first();
|
||||
await phoneRequiredFiled.click();
|
||||
await page.getByTestId("field-add-save").click();
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
};
|
||||
@@ -458,7 +458,7 @@ test.describe("Organization", () => {
|
||||
await page.locator('[data-testid="fixed-hosts-select"]').click();
|
||||
await page.locator(`text="${invitedUserEmail}"`).click();
|
||||
await page.locator('[data-testid="update-eventtype"]').click();
|
||||
await page.waitForResponse("/api/trpc/eventTypes/update?batch=1");
|
||||
await page.waitForResponse("/api/trpc/eventTypes/heavy/update?batch=1");
|
||||
|
||||
await expectPageToBeNotFound({ page, url: `/team/${team.slug}/${teamEvent.slug}` });
|
||||
await doOnOrgDomain(
|
||||
|
||||
@@ -35,7 +35,7 @@ test.describe("Payment app", () => {
|
||||
await page.getByPlaceholder("Price").click();
|
||||
await page.getByPlaceholder("Price").fill("200");
|
||||
await page.getByText("SatoshissatsCurrencyBTCPayment optionCollect payment on booking").click();
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/update?batch=1", {
|
||||
await submitAndWaitForResponse(page, "/api/trpc/eventTypes/heavy/update?batch=1", {
|
||||
action: () => page.locator("[data-testid=update-eventtype]").click(),
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user