Skip to content

Build your personal knowledge base with Trilium Notes

test(search): detect partial slash truncation

Amp0b4f387d72aa
diff --git a/apps/server/e2e/exact_search.spec.ts b/apps/server/e2e/exact_search.spec.ts
index 0e88f46e65..70fda87fb9 100644
--- a/apps/server/e2e/exact_search.spec.ts
+++ b/apps/server/e2e/exact_search.spec.ts
@@ -178,6 +178,14 @@ test.describe("Exact Search with Leading = Operator", () => {
const data = await response.json();
const noteIds = path === "quick-search" ? data.searchResultNoteIds : data;
expect(noteIds).toContain(noteId);
+
+ const negativeResponse = await page.request.get(getSearchUrl(path, "中/NoSuchTokenQwerty"), {
+ headers: { "x-csrf-token": csrfToken }
+ });
+ expect(negativeResponse.ok()).toBeTruthy();
+ const negativeData = await negativeResponse.json();
+ const negativeNoteIds = path === "quick-search" ? negativeData.searchResultNoteIds : negativeData;
+ expect(negativeNoteIds).not.toContain(noteId);
}
});