The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
update E2E tests
Steven Tey42c766df761e
diff --git a/apps/web/app/(ee)/api/cron/groups/remap-default-links/route.ts b/apps/web/app/(ee)/api/cron/groups/remap-default-links/route.tsindex 10a02926c1..9b30e41288 100644--- a/apps/web/app/(ee)/api/cron/groups/remap-default-links/route.ts+++ b/apps/web/app/(ee)/api/cron/groups/remap-default-links/route.ts@@ -76,6 +76,9 @@ export async function POST(req: Request) {not: null,},},+ orderBy: {+ createdAt: "asc",+ },},},}),diff --git a/apps/web/tests/bounties/index.test.ts b/apps/web/tests/bounties/index.test.tsindex c33abcdb14..f2d52517c5 100644--- a/apps/web/tests/bounties/index.test.ts+++ b/apps/web/tests/bounties/index.test.ts@@ -1,4 +1,5 @@import { Bounty } from "@dub/prisma/client";+import { E2E_PARTNER_GROUP } from "tests/utils/resource";import { describe, expect, onTestFinished, test } from "vitest";import { IntegrationHarness } from "../utils/integration";@@ -19,8 +20,6 @@ const performanceBounty = {rewardAmount: 1000,};-const BOUNTY_GROUP_ID = "grp_1K2E25381GVMG7HHM057TB92F";-describe.sequential("/bounties/**", async () => {const h = new IntegrationHarness();const { http } = await h.init();@@ -36,7 +35,7 @@ describe.sequential("/bounties/**", async () => {body: {...performanceBounty,startsAt,- groupIds: [BOUNTY_GROUP_ID],+ groupIds: [E2E_PARTNER_GROUP.id],performanceCondition: {attribute: "totalLeads",operator: "gte",@@ -62,7 +61,7 @@ describe.sequential("/bounties/**", async () => {body: {...submissionBounty,startsAt,- groupIds: [BOUNTY_GROUP_ID],+ groupIds: [E2E_PARTNER_GROUP.id],},});diff --git a/apps/web/tests/partners/create-partner.test.ts b/apps/web/tests/partners/create-partner.test.tsindex 620f11171e..bf5bb5a277 100644--- a/apps/web/tests/partners/create-partner.test.ts+++ b/apps/web/tests/partners/create-partner.test.ts@@ -5,7 +5,7 @@ import { R2_URL } from "@dub/utils";import { describe, expect, test } from "vitest";import { randomEmail, randomId } from "../utils/helpers";import { IntegrationHarness } from "../utils/integration";-import { E2E_PROGRAM } from "../utils/resource";+import { E2E_PARTNER_GROUP, E2E_PROGRAM } from "../utils/resource";import { normalizedPartnerDateFields } from "./resource";const EnrolledPartnerSchema = EnrolledPartnerSchemaDate.merge(@@ -20,6 +20,7 @@ describe.sequential("POST /partners", async () => {const partner = {name: generateRandomName(),email: randomEmail(),+ groupId: E2E_PARTNER_GROUP.id,};const { data, status } = await http.post<Link>({@@ -38,6 +39,7 @@ describe.sequential("POST /partners", async () => {name: generateRandomName(),email: randomEmail(),tenantId: randomId(),+ groupId: E2E_PARTNER_GROUP.id,description: "A description of the partner",country: "US",};@@ -76,6 +78,7 @@ describe.sequential("POST /partners", async () => {const partner = {name: generateRandomName(),email: randomEmail(),+ groupId: E2E_PARTNER_GROUP.id,};const { data, status } = await http.post<Link>({@@ -93,9 +96,8 @@ describe.sequential("POST /partners", async () => {expect(parsed.links).toEqual(expect.arrayContaining([expect.objectContaining({- id: expect.any(String),domain: E2E_PROGRAM.domain,- url: E2E_PROGRAM.url,+ url: E2E_PARTNER_GROUP.url,key: username,shortLink: `https://${E2E_PROGRAM.domain}/${username}`,clicks: 0,diff --git a/apps/web/tests/partners/resource.ts b/apps/web/tests/partners/resource.tsindex 5bb6926c8d..84ed54f119 100644--- a/apps/web/tests/partners/resource.ts+++ b/apps/web/tests/partners/resource.ts@@ -3,6 +3,7 @@ import z from "@/lib/zod";import { expect } from "vitest";import {E2E_PARTNER,+ E2E_PARTNER_GROUP,E2E_PROGRAM,E2E_USER_ID,E2E_WORKSPACE_ID,@@ -16,7 +17,7 @@ export const partnerLink = {workspaceId: E2E_WORKSPACE_ID,userId: E2E_USER_ID,domain: E2E_PROGRAM.domain,- url: E2E_PROGRAM.url,+ url: E2E_PARTNER_GROUP.url,programId: E2E_PROGRAM.id,partnerId: E2E_PARTNER.id,tenantId: E2E_PARTNER.tenantId,diff --git a/apps/web/tests/partners/upsert-partner-link.test.ts b/apps/web/tests/partners/upsert-partner-link.test.tsindex 9af5fa605b..0f029b072e 100644--- a/apps/web/tests/partners/upsert-partner-link.test.ts+++ b/apps/web/tests/partners/upsert-partner-link.test.ts@@ -3,7 +3,7 @@ import { nanoid } from "@dub/utils";import { randomId } from "tests/utils/helpers";import { afterAll, describe, expect, test } from "vitest";import { IntegrationHarness } from "../utils/integration";-import { E2E_PARTNER, E2E_PROGRAM } from "../utils/resource";+import { E2E_PARTNER, E2E_PARTNER_GROUP, E2E_PROGRAM } from "../utils/resource";import { partnerLink } from "./resource";describe.sequential("PUT /partners/links/upsert", async () => {@@ -16,7 +16,7 @@ describe.sequential("PUT /partners/links/upsert", async () => {await h.deleteLink(createdLink.id);});- const randomUrl = `${E2E_PROGRAM.url}/${nanoid()}`;+ const randomUrl = `${E2E_PARTNER_GROUP.url}/${nanoid()}`;test("New link", async () => {const { data, status } = await http.put<Link>({diff --git a/apps/web/tests/utils/resource.ts b/apps/web/tests/utils/resource.tsindex 731dffcee8..f3daff2f35 100644--- a/apps/web/tests/utils/resource.ts+++ b/apps/web/tests/utils/resource.ts@@ -79,10 +79,14 @@ export const E2E_DISCOUNT = {export const E2E_PROGRAM = {id: "prog_CYCu7IMAapjkRpTnr8F1azjN",domain: "getacme.link",- url: "https://acme.dub.sh",};export const E2E_PARTNER = {id: "pn_H4TB2V5hDIjpqB7PwrxESoY3",tenantId: "4149092f-7265-4002-98d9-da9f8e67e1fb",};++export const E2E_PARTNER_GROUP = {+ id: "grp_1K2E25381GVMG7HHM057TB92F",+ url: "https://acme.dub.sh/",+};