aboutsummaryrefslogtreecommitdiffstats
path: root/packages/e2e_tests
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-05-18 19:12:27 +0000
committerMohamed Bassem <me@mbassem.com>2025-05-18 19:12:27 +0000
commita5ae67c241d8cdd452acd4d98800ec61740c041f (patch)
treef04929b1b27000564d108f25918c6e70fe651fb6 /packages/e2e_tests
parent053d1a905ed6cef71151d168351f22b35ddca986 (diff)
downloadkarakeep-a5ae67c241d8cdd452acd4d98800ec61740c041f.tar.zst
feat(api): Expose the endpoint to create a new tag
Diffstat (limited to 'packages/e2e_tests')
-rw-r--r--packages/e2e_tests/tests/api/tags.test.ts27
1 files changed, 6 insertions, 21 deletions
diff --git a/packages/e2e_tests/tests/api/tags.test.ts b/packages/e2e_tests/tests/api/tags.test.ts
index 3e3cacc0..6c387628 100644
--- a/packages/e2e_tests/tests/api/tags.test.ts
+++ b/packages/e2e_tests/tests/api/tags.test.ts
@@ -26,31 +26,16 @@ describe("Tags API", () => {
});
it("should get, update and delete a tag", async () => {
- // Create a bookmark first
- const { data: createdBookmark } = await client.POST("/bookmarks", {
+ // Create a tag by attaching it to the bookmark
+ const { data: tag } = await client.POST("/tags", {
body: {
- type: "text",
- title: "Test Bookmark",
- text: "This is a test bookmark",
+ name: "Test Tag",
},
});
+ expect(tag).toBeDefined();
+ expect(tag!.name).toBe("Test Tag");
- // Create a tag by attaching it to the bookmark
- const { data: addTagResponse } = await client.POST(
- "/bookmarks/{bookmarkId}/tags",
- {
- params: {
- path: {
- bookmarkId: createdBookmark!.id,
- },
- },
- body: {
- tags: [{ tagName: "Test Tag" }],
- },
- },
- );
-
- const tagId = addTagResponse!.attached[0];
+ const tagId = tag!.id;
// Get the tag
const { data: retrievedTag, response: getResponse } = await client.GET(