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 upsert-link.test.ts

Steven Tey716f80f32e24
diff --git a/apps/web/tests/links/upsert-link.test.ts b/apps/web/tests/links/upsert-link.test.ts
index abf321c3f9..0de3109836 100644
--- a/apps/web/tests/links/upsert-link.test.ts
+++ b/apps/web/tests/links/upsert-link.test.ts
@@ -14,6 +14,8 @@ describe.sequential("PUT /links/upsert", async () => {
const { workspaceId } = workspace;
const projectId = workspaceId.replace("ws_", "");
+ let createdLink: Link;
+
test("New link", async () => {
const { data: createdLink } = await http.put<Link>({
path: "/links/upsert",
@@ -33,16 +35,16 @@ describe.sequential("PUT /links/upsert", async () => {
tags: [],
});
- test("Existing link", async () => {
- const { data: updatedLink } = await http.put<Link>({
- path: "/links/upsert",
- query: { workspaceId },
- body: { domain, url },
- });
+ await h.deleteLink(createdLink.id);
+ });
- expect(updatedLink).toStrictEqual(createdLink);
+ test("Existing link", async () => {
+ const { data: updatedLink } = await http.put<Link>({
+ path: "/links/upsert",
+ query: { workspaceId },
+ body: { domain, url },
});
- await h.deleteLink(createdLink.id);
+ expect(updatedLink).toStrictEqual(createdLink);
});
});