test: fix brain.add() return type usage in VFS tests
Fixed tests to correctly use brain.add() return value: - brain.add() returns string (entity ID), not Entity object - Updated tests to use knowledgeId instead of knowledgeEntity.id - Simple VFS filter test now passing (demonstrates filtering works) - 3/5 integration tests passing Verified working: ✅ brain.find() excludes VFS by default ✅ brain.find({ includeVFS: true }) includes VFS ✅ Type queries (Document, Collection) filter correctly ✅ Where clause with isVFS works ✅ VFS-knowledge relationships work Note: Semantic search tests still failing (Buffer embedding issue)
This commit is contained in:
parent
014b8104da
commit
970f2437d4
2 changed files with 102 additions and 2 deletions
|
|
@ -48,7 +48,7 @@ describe('VFS-Knowledge Separation (Option 3C)', () => {
|
|||
await vfs.writeFile('/docs/readme.md', '# Hello World')
|
||||
|
||||
// Create knowledge entity (no isVFS flag)
|
||||
const knowledgeEntity = await brain.add({
|
||||
const knowledgeId = await brain.add({
|
||||
data: 'This is a knowledge document about AI',
|
||||
type: NounType.Document,
|
||||
metadata: {
|
||||
|
|
@ -74,7 +74,7 @@ describe('VFS-Knowledge Separation (Option 3C)', () => {
|
|||
// Should only return knowledge entities (no VFS)
|
||||
expect(vfsResults.length).toBe(0)
|
||||
expect(knowledgeResults.length).toBeGreaterThan(0)
|
||||
expect(results.some(r => r.id === knowledgeEntity.id)).toBe(true)
|
||||
expect(results.some(r => r.id === knowledgeId)).toBe(true)
|
||||
})
|
||||
|
||||
it('should include VFS entities when includeVFS: true', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue