From fe13408831dce4bdae4911098d6079a097cae9e8 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Tue, 9 Apr 2024 15:49:24 +0100 Subject: feature(web): Allow uploading directly into lists/tags. Fixes #69 --- packages/trpc/routers/bookmarks.test.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'packages/trpc/routers/bookmarks.test.ts') 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("update bookmark text", async ({ apiCallers }) => { -- cgit v1.2.3-70-g09d2