aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc/lib/__tests__/search.test.ts
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-04-28 07:29:23 +0000
committerMohamed Bassem <me@mbassem.com>2025-04-28 07:29:23 +0000
commit5912277981fc27cd96cb9239565a1148d7e6fc8f (patch)
treed99fcef6de6f26b63550a2e606cdc06cbcb579df /packages/trpc/lib/__tests__/search.test.ts
parentd42c196729ecddc2b8646ce15be6cd2b362c05a6 (diff)
downloadkarakeep-5912277981fc27cd96cb9239565a1148d7e6fc8f.tar.zst
Revert "fix: Fix smart lists not working in list search qualifiers". #1321
This reverts commit 6178736d64180f9bc8954099c90d54aa2f9f35f5.
Diffstat (limited to 'packages/trpc/lib/__tests__/search.test.ts')
-rw-r--r--packages/trpc/lib/__tests__/search.test.ts69
1 files changed, 0 insertions, 69 deletions
diff --git a/packages/trpc/lib/__tests__/search.test.ts b/packages/trpc/lib/__tests__/search.test.ts
index 72b53368..9d9b39d7 100644
--- a/packages/trpc/lib/__tests__/search.test.ts
+++ b/packages/trpc/lib/__tests__/search.test.ts
@@ -34,12 +34,6 @@ beforeEach(async () => {
email: "test@example.com",
role: "user",
},
- {
- id: "another-user",
- name: "Another User",
- email: "another@example.com",
- role: "user",
- },
]);
// Setup test data
@@ -92,14 +86,6 @@ beforeEach(async () => {
favourited: false,
createdAt: new Date("2024-01-06"),
},
- {
- id: "b7",
- type: BookmarkTypes.ASSET,
- userId: "another-user",
- archived: true,
- favourited: false,
- createdAt: new Date("2024-01-06"),
- },
]);
await db.insert(bookmarkLinks).values([
@@ -157,21 +143,6 @@ beforeEach(async () => {
type: "manual",
},
{ id: "l4", userId: testUserId, name: "work", icon: "💼", type: "manual" },
- {
- id: "l5",
- userId: testUserId,
- name: "smartlist",
- icon: "🧠",
- type: "smart",
- query: "#tag1 or #tag2",
- },
- {
- id: "l6",
- userId: testUserId,
- name: "emptylist",
- icon: "∅",
- type: "manual",
- },
]);
await db.insert(bookmarksInLists).values([
@@ -253,26 +224,6 @@ describe("getBookmarkIdsFromMatcher", () => {
expect(result).toEqual(["b1", "b6"]);
});
- it("should handle listName matcher with smartList", async () => {
- const matcher: Matcher = {
- type: "listName",
- listName: "smartlist",
- inverse: false,
- };
- const result = await getBookmarkIdsFromMatcher(mockCtx, matcher);
- expect(result).toEqual(["b1", "b2"]);
- });
-
- it("should handle listName matcher with empty list", async () => {
- const matcher: Matcher = {
- type: "listName",
- listName: "emptylist",
- inverse: false,
- };
- const result = await getBookmarkIdsFromMatcher(mockCtx, matcher);
- expect(result).toEqual([]);
- });
-
it("should handle listName matcher with inverse=true", async () => {
const matcher: Matcher = {
type: "listName",
@@ -283,26 +234,6 @@ describe("getBookmarkIdsFromMatcher", () => {
expect(result.sort()).toEqual(["b2", "b3", "b4", "b5"]);
});
- it("should handle listName matcher with smartList with inverse=true", async () => {
- const matcher: Matcher = {
- type: "listName",
- listName: "smartlist",
- inverse: true,
- };
- const result = await getBookmarkIdsFromMatcher(mockCtx, matcher);
- expect(result).toEqual(["b3", "b4", "b5", "b6"]);
- });
-
- it("should handle listName matcher with empty list with inverse=true", async () => {
- const matcher: Matcher = {
- type: "listName",
- listName: "emptylist",
- inverse: true,
- };
- const result = await getBookmarkIdsFromMatcher(mockCtx, matcher);
- expect(result).toEqual(["b1", "b2", "b3", "b4", "b5", "b6"]);
- });
-
it("should handle archived matcher", async () => {
const matcher: Matcher = { type: "archived", archived: true };
const result = await getBookmarkIdsFromMatcher(mockCtx, matcher);