chore: improve readability of some tests (#16954)

This commit is contained in:
Benny Joo
2024-10-05 08:49:29 +05:30
committed by GitHub
parent a4a3eb5ea9
commit 8722745185
4 changed files with 18 additions and 15 deletions
+1 -1
View File
@@ -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");
@@ -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`);
+10 -10
View File
@@ -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);
@@ -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}