test: clarify memory wiki assertions

This commit is contained in:
Peter Steinberger
2026-05-08 12:03:52 +01:00
parent d7853ed5b3
commit feccd70b9d
3 changed files with 10 additions and 11 deletions

View File

@@ -3628,13 +3628,11 @@ describe("active-memory plugin", () => {
),
);
expect(
vi
.mocked(api.logger.info)
.mock.calls.some((call: unknown[]) =>
String(call[0]).includes(`transcript=${expectedDir}${path.sep}`),
),
).toBe(true);
expect(rmSpy.mock.calls.some(([target]) => String(target).startsWith(expectedDir))).toBe(false);
vi.mocked(api.logger.info).mock.calls.map((call: unknown[]) => String(call[0])),
).toContainEqual(expect.stringContaining(`transcript=${expectedDir}${path.sep}`));
expect(rmSpy.mock.calls.filter(([target]) => String(target).startsWith(expectedDir))).toEqual(
[],
);
});
it("falls back to the default transcript directory when transcriptDir is unsafe", async () => {

View File

@@ -59,6 +59,6 @@ describe("buildPageContradictionClusters", () => {
expect(clusters).toHaveLength(2);
expect(clusters.map((cluster) => cluster.key).toSorted()).toEqual(["किताब", "कीताब"]);
expect(clusters.every((cluster) => cluster.entries)).toBe(true);
expect(clusters.filter((cluster) => !cluster.entries)).toEqual([]);
});
});

View File

@@ -638,8 +638,9 @@ describe("searchMemoryWiki", () => {
});
expect(results).toHaveLength(2);
expect(results.some((result) => result.corpus === "wiki")).toBe(true);
expect(results.some((result) => result.corpus === "memory")).toBe(true);
expect(results.map((result) => result.corpus)).toEqual(
expect.arrayContaining(["wiki", "memory"]),
);
expect(manager.search).toHaveBeenCalledWith("alpha", { maxResults: 5 });
expect(getActiveMemorySearchManagerMock).toHaveBeenCalledWith({
cfg: createAppConfig(),
@@ -691,7 +692,7 @@ describe("searchMemoryWiki", () => {
});
expect(results).toHaveLength(5);
expect(results.some((result) => result.corpus === "memory")).toBe(true);
expect(results.map((result) => result.corpus)).toContain("memory");
expect(
results.filter((result) => result.corpus === "wiki").map((result) => result.path),
).toEqual([