From 55c72c715063cbcf69626fe5a7bca18f917f90ec Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 11 Jul 2024 14:12:43 +0200 Subject: [PATCH] Add tests --- .../server/src/api/routes/tests/search.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index 8d3722300f..e2335cb71c 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -809,6 +809,20 @@ describe.each([ }, }).toContainExactly([{ name: "foo" }, { name: "bar" }]) }) + + it("empty arrays returns all when onEmptyFilter is set to return 'all'", async () => { + await expectQuery({ + onEmptyFilter: EmptyFilterOption.RETURN_ALL, + oneOf: { name: [] }, + }).toContainExactly([{ name: "foo" }, { name: "bar" }]) + }) + + it("empty arrays returns all when onEmptyFilter is set to return 'none'", async () => { + await expectQuery({ + onEmptyFilter: EmptyFilterOption.RETURN_NONE, + oneOf: { name: [] }, + }).toContainExactly([]) + }) }) describe("fuzzy", () => {