aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/routers/bookmarks.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/trpc/routers/bookmarks.test.ts')
-rw-r--r--packages/trpc/routers/bookmarks.test.ts17
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 }) => {