import { it } from "../../../../../helpers"; import { Auth, Payments, Project, User, niceBackendFetch } from "../../../../backend-helpers"; it("should error on invalid code", async ({ expect }) => { await Project.createAndSwitch(); const response = await niceBackendFetch("/api/latest/payments/purchases/validate-code", { method: "POST", accessType: "client", body: { full_code: "invalid-code", }, }); expect(response).toMatchInlineSnapshot(` NiceResponse { "status": 404, "body": { "code": "VERIFICATION_CODE_NOT_FOUND", "error": "The verification code does not exist for this project.", }, "headers": Headers { "x-stack-known-error": "VERIFICATION_CODE_NOT_FOUND",