diff options
| author | MohamedBassem <me@mbassem.com> | 2024-05-06 18:05:27 +0100 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-05-06 18:05:27 +0100 |
| commit | 32b5a025568dcc5788a8a2afc19bf07264e01a63 (patch) | |
| tree | 7ad808c667148154c9244cb3def56315da89ef52 /packages/trpc/routers/bookmarks.test.ts | |
| parent | 02ef4bfc89e66fdf6593dd744aef53adee57b861 (diff) | |
| download | karakeep-32b5a025568dcc5788a8a2afc19bf07264e01a63.tar.zst | |
feature: Dedup links on creation. Fixes #49
Diffstat (limited to 'packages/trpc/routers/bookmarks.test.ts')
| -rw-r--r-- | packages/trpc/routers/bookmarks.test.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/trpc/routers/bookmarks.test.ts b/packages/trpc/routers/bookmarks.test.ts index 603c18fd..1bcd3279 100644 --- a/packages/trpc/routers/bookmarks.test.ts +++ b/packages/trpc/routers/bookmarks.test.ts @@ -116,18 +116,18 @@ describe("Bookmark Routes", () => { test<CustomTestContext>("update tags", async ({ apiCallers }) => { const api = apiCallers[0].bookmarks; - let bookmark = await api.createBookmark({ + const createdBookmark = await api.createBookmark({ url: "https://google.com", type: "link", }); await api.updateTags({ - bookmarkId: bookmark.id, + bookmarkId: createdBookmark.id, attach: [{ tagName: "tag1" }, { tagName: "tag2" }], detach: [], }); - bookmark = await api.getBookmark({ bookmarkId: bookmark.id }); + let bookmark = await api.getBookmark({ bookmarkId: createdBookmark.id }); expect(bookmark.tags.map((t) => t.name).sort()).toEqual(["tag1", "tag2"]); const tag1Id = bookmark.tags.filter((t) => t.name == "tag1")[0].id; @@ -157,17 +157,17 @@ describe("Bookmark Routes", () => { test<CustomTestContext>("update bookmark text", async ({ apiCallers }) => { const api = apiCallers[0].bookmarks; - let bookmark = await api.createBookmark({ + const createdBookmark = await api.createBookmark({ text: "HELLO WORLD", type: "text", }); await api.updateBookmarkText({ - bookmarkId: bookmark.id, + bookmarkId: createdBookmark.id, text: "WORLD HELLO", }); - bookmark = await api.getBookmark({ bookmarkId: bookmark.id }); + const bookmark = await api.getBookmark({ bookmarkId: createdBookmark.id }); assert(bookmark.content.type == "text"); expect(bookmark.content.text).toEqual("WORLD HELLO"); }); |
