Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add test

Steven Tey65b0937b4b18
diff --git a/apps/web/tests/customers/index.test.ts b/apps/web/tests/customers/index.test.ts
index 3e571a7a85..4c9e015d80 100644
--- a/apps/web/tests/customers/index.test.ts
+++ b/apps/web/tests/customers/index.test.ts
@@ -1,4 +1,5 @@
import { Customer } from "@/lib/types";
+import { CustomerEnrichedSchema } from "@/lib/zod/schemas/customers";
import { describe, expect, test } from "vitest";
import { IntegrationHarness } from "../utils/integration";
@@ -54,4 +55,19 @@ describe.sequential("/customers/**", async () => {
...toUpdate,
});
});
+
+ test("GET /customers by externalId with includeExpandedFields", async () => {
+ const { status, data: customers } = await http.get<Customer[]>({
+ path: `/customers?externalId=${expectedCustomer.externalId}&includeExpandedFields=true`,
+ });
+
+ expect(status).toEqual(200);
+ expect(customers.length).toBeGreaterThanOrEqual(1);
+ expect(
+ CustomerEnrichedSchema.parse({
+ ...customers[0],
+ createdAt: new Date(customers[0].createdAt),
+ }),
+ ).toBeTruthy();
+ });
});