Skip to content

Build your personal knowledge base with Trilium Notes

Update apps/client/src/services/search.spec.ts

Elian Doran2011e06fab73
diff --git a/apps/client/src/services/search.spec.ts b/apps/client/src/services/search.spec.ts
index 584bf4a497..707ab7f995 100644
--- a/apps/client/src/services/search.spec.ts
+++ b/apps/client/src/services/search.spec.ts
@@ -69,7 +69,7 @@ describe("search service", () => {
expect(await searchService.runSearchNote(component, "search1", "ntx1")).toEqual({ error: undefined });
expect(showError).not.toHaveBeenCalled();
- // A failed request says nothing about the query, so it returns no result to replace its error.
+ // `runSearchNote()` returns `undefined` after a failed request, so the caller keeps the query error.
loadSearchNote.mockRejectedValueOnce(new Error("Network down"));
expect(await searchService.runSearchNote(component, "search1", "ntx1")).toBeUndefined();
expect(showError).toHaveBeenCalledWith("Network down");