fix: Update Event Type Pricing For Multiple Installed Payment Apps (#12272)

* Prevent two payment apps from being enabled

* Find the enabled payment app to update the event type

* Add string

* Add tests

* Type fix

* Abstract check for multiple payment app logic

* Type check

* Address feedback

* chore: Enable One Payment App Per Event Type (#12414)

Co-authored-by: Morgan <[email protected]>
Co-authored-by: Morgan Vernay <[email protected]>

* Fix bug

* Fix test

* Clean up

* Fix test

* Fix test

---------

Co-authored-by: Morgan <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Omar López <[email protected]>
Co-authored-by: Morgan Vernay <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-12-20 13:29:23 -05:00
1 parent 68d40cabbe
commit d07e86e4f3
15 files changed
+273 -53

No files matched your search

+4 -4
View File
@@ -508,8 +508,8 @@ const createUserFixture = (user: UserWithIncludes, page: Page) => {
});
},
getPaymentCredential: async () => getPaymentCredential(store.page),
setupEventWithPrice: async (eventType: Pick<Prisma.EventType, "id">) =>
setupEventWithPrice(eventType, store.page),
setupEventWithPrice: async (eventType: Pick<Prisma.EventType, "id">, slug: string) =>
setupEventWithPrice(eventType, slug, store.page),
bookAndPayEvent: async (eventType: Pick<Prisma.EventType, "slug">) =>
bookAndPayEvent(user, eventType, store.page),
makePaymentUsingStripe: async () => makePaymentUsingStripe(store.page),
@@ -693,9 +693,9 @@ export async function apiLogin(
});
}
export async function setupEventWithPrice(eventType: Pick<Prisma.EventType, "id">, page: Page) {
export async function setupEventWithPrice(eventType: Pick<Prisma.EventType, "id">, slug: string, page: Page) {
await page.goto(`/event-types/${eventType?.id}?tabName=apps`);
await page.locator("[data-testid='app-switch']").first().click();
await page.locator(`[data-testid='${slug}-app-switch']`).first().click();
await page.getByPlaceholder("Price").fill("100");
await page.getByTestId("update-eventtype").click();
}