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.

Update index.test.ts

Kiran K707945674b5b
diff --git a/apps/web/tests/commissions/index.test.ts b/apps/web/tests/commissions/index.test.ts
index cd6186863b..30d763aa90 100644
--- a/apps/web/tests/commissions/index.test.ts
+++ b/apps/web/tests/commissions/index.test.ts
@@ -1,10 +1,7 @@
-import { CommissionEnrichedSchema } from "@/lib/zod/schemas/commissions";
+import { CommissionResponse } from "@/lib/types";
import { describe, expect, test } from "vitest";
-import { z } from "zod";
import { IntegrationHarness } from "../utils/integration";
-type Commission = z.infer<typeof CommissionEnrichedSchema>;
-
const expectedCommission = {
id: expect.any(String),
amount: expect.any(Number),
@@ -25,7 +22,7 @@ describe.sequential("/commissions/**", async () => {
let testPaidCommissionId: string;
test("GET /commissions", async () => {
- const { status, data: commissions } = await http.get<Commission[]>({
+ const { status, data: commissions } = await http.get<CommissionResponse[]>({
path: "/commissions",
query: {
status: "processed",
@@ -46,7 +43,7 @@ describe.sequential("/commissions/**", async () => {
test("GET /commissions with filters", async () => {
// Get paid commissions
const { status: paidStatus, data: paidCommissions } = await http.get<
- Commission[]
+ CommissionResponse[]
>({
path: "/commissions",
query: {
@@ -68,7 +65,7 @@ describe.sequential("/commissions/**", async () => {
amount: 5000, // $50.00 in cents
};
- const { status, data: commission } = await http.patch<Commission>({
+ const { status, data: commission } = await http.patch<CommissionResponse>({
path: `/commissions/${testCommissionId}`,
body: toUpdate,
});
@@ -86,7 +83,7 @@ describe.sequential("/commissions/**", async () => {
currency: "usd",
};
- const { status, data: commission } = await http.patch<Commission>({
+ const { status, data: commission } = await http.patch<CommissionResponse>({
path: `/commissions/${testCommissionId}`,
body: toUpdate,
});
@@ -101,7 +98,7 @@ describe.sequential("/commissions/**", async () => {
currency: "jpy",
};
- const { status, data: commission } = await http.patch<Commission>({
+ const { status, data: commission } = await http.patch<CommissionResponse>({
path: `/commissions/${testCommissionId}`,
body: toUpdate,
});
@@ -117,7 +114,7 @@ describe.sequential("/commissions/**", async () => {
amount: 5000,
};
- const response = await http.patch<Commission>({
+ const response = await http.patch<CommissionResponse>({
path: `/commissions/${testLeadCommissionId}`,
body: toUpdate,
});
@@ -131,7 +128,7 @@ describe.sequential("/commissions/**", async () => {
amount: 5000,
};
- const response = await http.patch<Commission>({
+ const response = await http.patch<CommissionResponse>({
path: `/commissions/${testPaidCommissionId}`,
body: toUpdate,
});
@@ -145,7 +142,7 @@ describe.sequential("/commissions/**", async () => {
status: "refunded",
};
- const { status, data: commission } = await http.patch<Commission>({
+ const { status, data: commission } = await http.patch<CommissionResponse>({
path: `/commissions/${testCommissionId}`,
body: toUpdate,
});