Skip to content

Build your personal knowledge base with Trilium Notes

test(client/collections): give NoteList's child fixtures real froca notes

Claudea695987a069a
diff --git a/apps/client/src/widgets/collections/NoteList.spec.tsx b/apps/client/src/widgets/collections/NoteList.spec.tsx
index 0cf23e1ab0..44729fbfa7 100644
--- a/apps/client/src/widgets/collections/NoteList.spec.tsx
+++ b/apps/client/src/widgets/collections/NoteList.spec.tsx
@@ -18,12 +18,20 @@ import Component from "../../components/component";
import type FNote from "../../entities/fnote";
import type { EntityChange } from "../../server_types";
import LoadResults from "../../services/load_results";
-import { buildNote } from "../../test/easy-froca";
+import { buildNote, buildNotes } from "../../test/easy-froca";
import { ParentComponent } from "../react/react_utils";
import { CustomNoteList, useNoteIds } from "./NoteList";
let currentNoteIds: string[] = [];
+// The child ids below stand for real notes: a collection view resolves the ids it is given through
+// froca.getNotes(), which round-trips to the server for anything the mock does not hold.
+buildNotes([
+ { id: "child-a", title: "Child A" },
+ { id: "child-b", title: "Child B" },
+ { id: "child-new", title: "Child New" }
+]);
+
/** Drains the chained awaits in `refreshNoteIds` (getNoteIds → search promise → setNoteIds). */
async function flushMicrotasks() {
await new Promise((resolve) => setTimeout(resolve));