From 5495b9c269deb9d62bdfd16440ecdedf754ee07f Mon Sep 17 00:00:00 2001 From: Bilal Godil Date: Tue, 7 Oct 2025 14:21:44 -0700 Subject: [PATCH] fix tests --- .../outdated--purchase-session.test.ts | 18 ++++------ .../outdated--validate-code.test.ts | 35 ++----------------- .../api/v1/payments/purchase-session.test.ts | 18 ++++------ .../api/v1/payments/validate-code.test.ts | 35 ++----------------- 4 files changed, 20 insertions(+), 86 deletions(-) diff --git a/apps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.ts b/apps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.ts index ba81b64c3..a84a0f20e 100644 --- a/apps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.ts +++ b/apps/e2e/tests/backend/endpoints/api/v1/payments/before-offer-to-product-rename/outdated--purchase-session.test.ts @@ -793,17 +793,13 @@ it("should block one-time purchase for same product after prior one-time purchas accessType: "client", body: { customer_type: "user", customer_id: userId, offer_id: "ot" }, }); - expect(createUrl2.status).toBe(200); - const code2 = (createUrl2.body as { url: string }).url.match(/\/purchase\/([a-z0-9-_]+)/)?.[1]; - expect(code2).toBeDefined(); - - const res = await niceBackendFetch("/api/v1/payments/purchases/purchase-session", { - method: "POST", - accessType: "client", - body: { full_code: code2, price_id: "one", quantity: 1 }, - }); - expect(res.status).toBe(400); - expect(String(res.body)).toBe("Customer already has purchased this product; this product is not stackable"); + expect(createUrl2).toMatchInlineSnapshot(` + NiceResponse { + "status": 400, + "body": "Customer already has purchased this product; this product is not stackable", + "headers": Headers {