diff options
| author | MohamedBassem <me@mbassem.com> | 2024-04-09 15:49:24 +0100 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-04-09 15:49:24 +0100 |
| commit | fe13408831dce4bdae4911098d6079a097cae9e8 (patch) | |
| tree | 228bbb192b3a0f3417a4526c382b0a3ddf7e04ff /packages/trpc/routers/bookmarks.test.ts | |
| parent | 994691b02515dfb579a5c3618631065bd76b9e4b (diff) | |
| download | karakeep-fe13408831dce4bdae4911098d6079a097cae9e8.tar.zst | |
feature(web): Allow uploading directly into lists/tags. Fixes #69
Diffstat (limited to 'packages/trpc/routers/bookmarks.test.ts')
| -rw-r--r-- | packages/trpc/routers/bookmarks.test.ts | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/packages/trpc/routers/bookmarks.test.ts b/packages/trpc/routers/bookmarks.test.ts index 58f4739d..603c18fd 100644 --- a/packages/trpc/routers/bookmarks.test.ts +++ b/packages/trpc/routers/bookmarks.test.ts @@ -123,7 +123,7 @@ describe("Bookmark Routes", () => { await api.updateTags({ bookmarkId: bookmark.id, - attach: [{ tag: "tag1" }, { tag: "tag2" }], + attach: [{ tagName: "tag1" }, { tagName: "tag2" }], detach: [], }); @@ -134,12 +134,25 @@ describe("Bookmark Routes", () => { await api.updateTags({ bookmarkId: bookmark.id, - attach: [{ tag: "tag3" }], + attach: [{ tagName: "tag3" }], detach: [{ tagId: tag1Id }], }); bookmark = await api.getBookmark({ bookmarkId: bookmark.id }); expect(bookmark.tags.map((t) => t.name).sort()).toEqual(["tag2", "tag3"]); + + await api.updateTags({ + bookmarkId: bookmark.id, + attach: [{ tagId: tag1Id }, { tagName: "tag4" }], + detach: [], + }); + bookmark = await api.getBookmark({ bookmarkId: bookmark.id }); + expect(bookmark.tags.map((t) => t.name).sort()).toEqual([ + "tag1", + "tag2", + "tag3", + "tag4", + ]); }); test<CustomTestContext>("update bookmark text", async ({ apiCallers }) => { |
