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.

fix more tests

Steven Tey870efabf844c
diff --git a/apps/web/app/api/tags/route.ts b/apps/web/app/api/tags/route.ts
index 7a0a88ac2e..b2552dd9a0 100644
--- a/apps/web/app/api/tags/route.ts
+++ b/apps/web/app/api/tags/route.ts
@@ -48,7 +48,7 @@ export const GET = withWorkspace(
},
);
-// POST /api/workspaces/[idOrSlug]/tags - create a tag for a workspace
+// POST /api/tags - create a tag for a workspace
export const POST = withWorkspace(
async ({ req, workspace, headers }) => {
const tagsCount = await prisma.tag.count({
diff --git a/apps/web/lib/api/links/utils/transform-link.ts b/apps/web/lib/api/links/utils/transform-link.ts
index d8f0480be9..e758669d19 100644
--- a/apps/web/lib/api/links/utils/transform-link.ts
+++ b/apps/web/lib/api/links/utils/transform-link.ts
@@ -10,7 +10,7 @@ export const transformLink = (link: LinkWithTags) => {
const tags = (link.tags || []).map(({ tag }) => tag);
const webhookIds = link.webhooks?.map(({ webhookId }) => webhookId) ?? [];
- // remove webhooks from link
+ // remove webhooks array from link
const { webhooks, ...rest } = link;
return {
diff --git a/apps/web/tests/links/update-link.test.ts b/apps/web/tests/links/update-link.test.ts
index 08e9f29f5b..9c18f3bc8b 100644
--- a/apps/web/tests/links/update-link.test.ts
+++ b/apps/web/tests/links/update-link.test.ts
@@ -62,7 +62,6 @@ describe.sequential("PATCH /links/{linkId}", async () => {
projectId,
shortLink: `https://${domain}/${toUpdate.key}`,
qrCode: `https://api.dub.co/qr?url=https://${domain}/${toUpdate.key}?qr=1`,
- webhooks: expect.any(Array),
});
// Fetch the link
@@ -106,7 +105,6 @@ describe.sequential("PATCH /links/{linkId}", async () => {
projectId,
shortLink: `https://${domain}/${toUpdate.key}`,
qrCode: `https://api.dub.co/qr?url=https://${domain}/${toUpdate.key}?qr=1`,
- webhooks: expect.any(Array),
});
// Fetch the link
@@ -139,7 +137,6 @@ describe.sequential("PATCH /links/{linkId}", async () => {
projectId,
shortLink: `https://${domain}/${toUpdate.key}`,
qrCode: `https://api.dub.co/qr?url=https://${domain}/${toUpdate.key}?qr=1`,
- webhooks: expect.any(Array),
});
// Fetch the link
@@ -173,7 +170,6 @@ describe.sequential("PATCH /links/{linkId}", async () => {
projectId,
shortLink: `https://${domain}/${toUpdate.key}`,
qrCode: `https://api.dub.co/qr?url=https://${domain}/${toUpdate.key}?qr=1`,
- webhooks: expect.any(Array),
});
// Fetch the link
@@ -242,7 +238,6 @@ describe.sequential(
projectId,
shortLink: `https://${domain}/${toUpdate.key}`,
qrCode: `https://api.dub.co/qr?url=https://${domain}/${toUpdate.key}?qr=1`,
- webhooks: expect.any(Array),
});
// Fetch the link
diff --git a/apps/web/tests/links/upsert-link.test.ts b/apps/web/tests/links/upsert-link.test.ts
index 8a519d5072..41cd97f5d3 100644
--- a/apps/web/tests/links/upsert-link.test.ts
+++ b/apps/web/tests/links/upsert-link.test.ts
@@ -55,7 +55,6 @@ describe.sequential("PUT /links/upsert", async () => {
comments: "Updated comment",
shortLink: `https://${domain}/${createdLink.key}`,
qrCode: `https://api.dub.co/qr?url=https://${domain}/${createdLink.key}?qr=1`,
- webhooks: expect.any(Array),
});
});
});