From 8722745185842c06fc17c38df68501a214a0228d Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Fri, 4 Oct 2024 23:19:29 -0400 Subject: [PATCH] chore: improve readability of some tests (#16954) --- apps/web/playwright/availability.e2e.ts | 2 +- .../web/playwright/integrations-stripe.e2e.ts | 8 ++++---- apps/web/playwright/payment-apps.e2e.ts | 20 +++++++++---------- .../EventTypeAppSettingsInterface.tsx | 3 +++ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/apps/web/playwright/availability.e2e.ts b/apps/web/playwright/availability.e2e.ts index e01068cad0..961426022b 100644 --- a/apps/web/playwright/availability.e2e.ts +++ b/apps/web/playwright/availability.e2e.ts @@ -110,7 +110,7 @@ test.describe("Availablity", () => { await expect(page.locator('[data-testid="date-overrides-list"] > li')).toHaveCount(1); }); - test("@test Schedule listing", async ({ page }) => { + test("Schedule listing", async ({ page }) => { await test.step("Can add a new schedule", async () => { await page.getByTestId("new-schedule").click(); await page.locator('[id="name"]').fill("More working hours"); diff --git a/apps/web/playwright/integrations-stripe.e2e.ts b/apps/web/playwright/integrations-stripe.e2e.ts index e4a51a3d25..716a690bf2 100644 --- a/apps/web/playwright/integrations-stripe.e2e.ts +++ b/apps/web/playwright/integrations-stripe.e2e.ts @@ -233,8 +233,8 @@ test.describe("Stripe integration skip true", () => { // Select currency in dropdown await page.getByTestId("stripe-currency-select").click(); - await page.locator("#react-select-2-input").fill("mexi"); - await page.locator("#react-select-2-option-81").click(); + await page.getByTestId("stripe-currency-input").fill("mexi"); + await page.getByTestId("select-option-mxn").click(); await page.getByTestId("update-eventtype").click(); @@ -467,8 +467,8 @@ test.describe("Stripe integration with the new app install flow skip false", () // Select currency in dropdown await page.getByTestId("stripe-currency-select").click(); - await page.locator("#react-select-2-input").fill("mexi"); - await page.locator("#react-select-2-option-81").click(); + await page.getByTestId("stripe-currency-input").fill("mexi"); + await page.getByTestId("select-option-mxn").click(); await page.click(`[data-testid="configure-step-save"]`); await page.waitForURL(`event-types`); diff --git a/apps/web/playwright/payment-apps.e2e.ts b/apps/web/playwright/payment-apps.e2e.ts index 01472dbd66..ee5ea0929c 100644 --- a/apps/web/playwright/payment-apps.e2e.ts +++ b/apps/web/playwright/payment-apps.e2e.ts @@ -121,7 +121,7 @@ test.describe("Payment app", () => { await page.getByPlaceholder("Price").fill("150"); await page.getByTestId("paypal-currency-select").click(); - await page.locator("#react-select-2-option-13").click(); + await page.getByTestId("select-option-MXN").click(); await page.getByTestId("paypal-payment-option-select").click(); @@ -314,13 +314,13 @@ test.describe("Payment app", () => { await page.goto(`event-types/${paymentEvent.id}?tabName=apps`); - await page.locator("[data-testid='paypal-app-switch']").click(); - await page.locator("[data-testid='paypal-price-input']").fill("100"); - await page.locator("[data-testid='paypal-currency-select']").first().click(); - await page.locator("#react-select-2-option-13").click(); + await page.getByTestId("paypal-app-switch").click(); + await page.getByTestId("paypal-price-input").fill("100"); + await page.getByTestId("paypal-currency-select").first().click(); + await page.getByTestId("select-option-MXN").click(); // await page.locator(".mb-1 > .bg-default > div > div:nth-child(2)").first().click(); // await page.getByText("$MXNCurrencyMexican pesoPayment option").click(); - await page.locator("[data-testid='update-eventtype']").click(); + await page.getByTestId("update-eventtype").click(); // Need to wait for the DB to be updated await page.waitForResponse((res) => res.url().includes("update") && res.status() === 200); @@ -336,10 +336,10 @@ test.describe("Payment app", () => { expect(paypalPrice?.price).toEqual(10000); - await page.locator("[data-testid='paypal-app-switch']").click(); - await page.locator("[data-testid='stripe-app-switch']").click(); - await page.locator("[data-testid='stripe-price-input']").fill("200"); - await page.locator("[data-testid='update-eventtype']").click(); + await page.getByTestId("paypal-app-switch").click(); + await page.getByTestId("stripe-app-switch").click(); + await page.getByTestId("stripe-price-input").fill("200"); + await page.getByTestId("update-eventtype").click(); // Need to wait for the DB to be updated await page.waitForResponse((res) => res.url().includes("update") && res.status() === 200); diff --git a/packages/app-store/stripepayment/components/EventTypeAppSettingsInterface.tsx b/packages/app-store/stripepayment/components/EventTypeAppSettingsInterface.tsx index b7750140c7..d0b4eac70c 100644 --- a/packages/app-store/stripepayment/components/EventTypeAppSettingsInterface.tsx +++ b/packages/app-store/stripepayment/components/EventTypeAppSettingsInterface.tsx @@ -93,6 +93,9 @@ const EventTypeAppSettingsInterface: EventTypeAppSettingsComponent = ({ data-testid="stripe-currency-select" variant="default" options={currencyOptions} + innerClassNames={{ + input: "stripe-currency-input", + }} value={selectedCurrency} className="text-black" defaultValue={selectedCurrency}