The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Set avatar as null for `randomCustomer()` (#3610)
Steven Teyec77391bd9b9
diff --git a/apps/web/lib/zod/schemas/sales.ts b/apps/web/lib/zod/schemas/sales.tsindex ae087e23cc..8c4b266651 100644--- a/apps/web/lib/zod/schemas/sales.ts+++ b/apps/web/lib/zod/schemas/sales.ts@@ -19,7 +19,7 @@ export const trackSaleRequestSchema = z.object({.int().min(0, "amount cannot be negative").describe(- "The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency",+ "The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1580` JPY). Learn more: https://d.to/currency",),currency: z.string()diff --git a/apps/web/tests/commissions/index.test.ts b/apps/web/tests/commissions/index.test.tsindex e193f4c1e3..69680ee346 100644--- a/apps/web/tests/commissions/index.test.ts+++ b/apps/web/tests/commissions/index.test.ts@@ -98,7 +98,7 @@ describe.sequential("/commissions/**", async () => {test("PATCH /commissions/{id} - foreign currency conversion", async () => {const toUpdate = {- amount: 1437, // approximately 1000 USD cents+ amount: 1580, // approximately 1000 USD centscurrency: "jpy",};diff --git a/apps/web/tests/tracks/track-sale.test.ts b/apps/web/tests/tracks/track-sale.test.tsindex bab5fc87ba..958988547a 100644--- a/apps/web/tests/tracks/track-sale.test.ts+++ b/apps/web/tests/tracks/track-sale.test.ts@@ -133,7 +133,7 @@ describe.concurrent("POST /track/sale", async () => {...sale,eventName: "Payment in JPY",invoiceId: `INV_${randomId()}`,- amount: 1437, // approximately 1000 USD cents+ amount: 1580, // approximately 1000 USD centscurrency: "jpy",};@@ -146,7 +146,7 @@ describe.concurrent("POST /track/sale", async () => {});// Check if the converted amount is within an acceptable range- // 1437 JPY should be around 1000 USD cents (±100)+ // 1580 JPY should be around 1000 USD cents (±100)expect(response.status).toEqual(200);expect(response.data.sale?.currency).toEqual("usd");expect(response.data.sale?.amount).toBeGreaterThanOrEqual(900); // 900 centsdiff --git a/apps/web/tests/utils/helpers.ts b/apps/web/tests/utils/helpers.tsindex 695bf72051..4ea82ad397 100644--- a/apps/web/tests/utils/helpers.ts+++ b/apps/web/tests/utils/helpers.ts@@ -1,5 +1,5 @@import { generateRandomName } from "@/lib/names";-import { OG_AVATAR_URL, nanoid, randomValue } from "@dub/utils";+import { nanoid, randomValue } from "@dub/utils";import { expect } from "vitest";export const randomId = (length = 24) => nanoid(length);@@ -15,7 +15,7 @@ export const randomCustomer = ({externalId,name: customerName,email: `${customerName.split(" ").join(".").toLowerCase()}@${emailDomain}`,- avatar: `${OG_AVATAR_URL}${externalId}`,+ avatar: null,};};