Update test to expect all matching contexts joined
Test now expects contexts to be joined with \n\n as implemented
This commit is contained in:
parent
e2b6700113
commit
cbb7a13d98
@ -601,7 +601,7 @@ describe("Path Context", () => {
|
||||
await cleanupTestDb(store);
|
||||
});
|
||||
|
||||
test("getContextForFile returns most specific context", async () => {
|
||||
test("getContextForFile returns all matching contexts", async () => {
|
||||
const store = await createTestStore();
|
||||
const collectionName = await createTestCollection({ pwd: "/test/collection", glob: "**/*.md" });
|
||||
await addPathContext(collectionName, "/", "General test files");
|
||||
@ -622,9 +622,10 @@ describe("Path Context", () => {
|
||||
displayPath: "docs/api/reference.md",
|
||||
});
|
||||
|
||||
// Context now returns ALL matching contexts joined with \n\n
|
||||
expect(store.getContextForFile("/test/collection/readme.md")).toBe("General test files");
|
||||
expect(store.getContextForFile("/test/collection/docs/guide.md")).toBe("Documentation files");
|
||||
expect(store.getContextForFile("/test/collection/docs/api/reference.md")).toBe("API documentation");
|
||||
expect(store.getContextForFile("/test/collection/docs/guide.md")).toBe("General test files\n\nDocumentation files");
|
||||
expect(store.getContextForFile("/test/collection/docs/api/reference.md")).toBe("General test files\n\nDocumentation files\n\nAPI documentation");
|
||||
|
||||
await cleanupTestDb(store);
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user