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 the some tests

Kiran K207abf70de1d
diff --git a/apps/web/tests/links/create-link.test.ts b/apps/web/tests/links/create-link.test.ts
index f510382f91..4f45482de0 100644
--- a/apps/web/tests/links/create-link.test.ts
+++ b/apps/web/tests/links/create-link.test.ts
@@ -174,7 +174,7 @@ describe.sequential("POST /links", async () => {
});
test("link expiration", async () => {
- const expiresAt = "Apr 16, 2030, 5:00 PM";
+ const expiresAt = new Date("2030-04-16T17:00:00.000Z");
const expiredUrl = "https://github.com/expired";
const { status, data: link } = await http.post<Link>({
diff --git a/apps/web/tests/links/list-links.test.ts b/apps/web/tests/links/list-links.test.ts
index 20c0d3294f..b824591dfe 100644
--- a/apps/web/tests/links/list-links.test.ts
+++ b/apps/web/tests/links/list-links.test.ts
@@ -41,7 +41,7 @@ test("GET /links", async (ctx) => {
emailVerified: null,
source: null,
subscribed: true,
- image: null,
+ image: expect.anything(),
name: expect.any(String),
createdAt: expect.any(String),
email: expect.any(String),
diff --git a/apps/web/tests/links/retrieve-link.test.ts b/apps/web/tests/links/retrieve-link.test.ts
index d961fd8829..f0db10e56c 100644
--- a/apps/web/tests/links/retrieve-link.test.ts
+++ b/apps/web/tests/links/retrieve-link.test.ts
@@ -20,7 +20,7 @@ test("GET /links/info", async (ctx) => {
archived: true,
publicStats: true,
comments: "This is a test",
- expiresAt: new Date("2030-04-16 23:59:59"),
+ expiresAt: new Date("2030-04-16T17:00:00.000Z"),
expiredUrl: "https://github.com/expired",
password: "link-password",
ios: "https://apps.apple.com/app/1611158928",
@@ -46,7 +46,7 @@ test("GET /links/info", async (ctx) => {
projectId,
workspaceId,
userId: user.id,
- expiresAt: "2030-04-16T23:59:59.000Z",
+ expiresAt: "2030-04-16T17:00:00.000Z",
shortLink: `https://${domain}/${newLink.key}`,
qrCode: `https://api.dub.co/qr?url=https://${domain}/${newLink.key}?qr=1`,
tags: [],
diff --git a/apps/web/tests/links/update-link.test.ts b/apps/web/tests/links/update-link.test.ts
index 829d680f2e..d500c5051c 100644
--- a/apps/web/tests/links/update-link.test.ts
+++ b/apps/web/tests/links/update-link.test.ts
@@ -31,7 +31,7 @@ describe("PUT /links/{linkId}", async () => {
description: "Open-source link management infrastructure.",
publicStats: true,
comments: "This is a comment.",
- expiresAt: new Date("2030-04-16 23:59:59"),
+ expiresAt: new Date("2030-04-16T17:00:00.000Z"),
expiredUrl: "https://github.com/expired",
password: "link-password",
ios: "https://apps.apple.com/app/1611158928",
@@ -51,7 +51,7 @@ describe("PUT /links/{linkId}", async () => {
expect(updatedLink).toStrictEqual({
...expectedLink,
...newLink,
- expiresAt: "2030-04-16T23:59:59.000Z",
+ expiresAt: "2030-04-16T17:00:00.000Z",
domain,
projectId,
workspaceId,
diff --git a/apps/web/tests/utils/schema.ts b/apps/web/tests/utils/schema.ts
index c99a2da5fc..e8bf712515 100644
--- a/apps/web/tests/utils/schema.ts
+++ b/apps/web/tests/utils/schema.ts
@@ -30,6 +30,7 @@ export const expectedLink: Partial<Link> & { tagId: string | null } = {
createdAt: expect.any(String),
updatedAt: expect.any(String),
expiredUrl: null,
+ externalId: null,
};
export const expectedTag: Partial<Tag> = {