aboutsummaryrefslogtreecommitdiffstats
path: root/packages/e2e_tests/tests/api
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-01-02 13:00:58 +0200
committerGitHub <noreply@github.com>2025-01-02 13:00:58 +0200
commit5ecdc36b7d60aa66b49e01e9fec8ba61ad537376 (patch)
tree57577822bb104b95900ba577a265fb4f8cf70b78 /packages/e2e_tests/tests/api
parent5df0258b2cd884347eabfa866d7e7fbc7225cdb3 (diff)
downloadkarakeep-5ecdc36b7d60aa66b49e01e9fec8ba61ad537376.tar.zst
feat: Add support for smart lists (#802)
* feat: Add support for smart lists * i18n * Fix update list endpoint * Add a test for smart lists * Add header to the query explainer * Hide remove from lists in the smart context list * Add proper validation to list form --------- Co-authored-by: Deepak Kapoor <41769111+orthdron@users.noreply.github.com>
Diffstat (limited to 'packages/e2e_tests/tests/api')
-rw-r--r--packages/e2e_tests/tests/api/lists.test.ts47
1 files changed, 47 insertions, 0 deletions
diff --git a/packages/e2e_tests/tests/api/lists.test.ts b/packages/e2e_tests/tests/api/lists.test.ts
index 2a954b6f..657d8535 100644
--- a/packages/e2e_tests/tests/api/lists.test.ts
+++ b/packages/e2e_tests/tests/api/lists.test.ts
@@ -182,4 +182,51 @@ describe("Lists API", () => {
expect(updatedListBookmarks!.bookmarks.length).toBe(0);
});
+
+ it("should support smart lists", async () => {
+ // Create a bookmark
+ const { data: createdBookmark1 } = await client.POST("/bookmarks", {
+ body: {
+ type: "text",
+ title: "Test Bookmark",
+ text: "This is a test bookmark",
+ favourited: true,
+ },
+ });
+
+ const { data: _ } = await client.POST("/bookmarks", {
+ body: {
+ type: "text",
+ title: "Test Bookmark",
+ text: "This is a test bookmark",
+ favourited: false,
+ },
+ });
+
+ // Create a list
+ const { data: createdList } = await client.POST("/lists", {
+ body: {
+ name: "Test List",
+ icon: "🚀",
+ type: "smart",
+ query: "is:fav",
+ },
+ });
+
+ // Get bookmarks in list
+ const { data: listBookmarks, response: getResponse } = await client.GET(
+ "/lists/{listId}/bookmarks",
+ {
+ params: {
+ path: {
+ listId: createdList!.id,
+ },
+ },
+ },
+ );
+
+ expect(getResponse.status).toBe(200);
+ expect(listBookmarks!.bookmarks.length).toBe(1);
+ expect(listBookmarks!.bookmarks[0].id).toBe(createdBookmark1!.id);
+ });
});