diff --git a/tests/integration/find-fields-projection.test.ts b/tests/integration/find-fields-projection.test.ts index df94e942..5d339f08 100644 --- a/tests/integration/find-fields-projection.test.ts +++ b/tests/integration/find-fields-projection.test.ts @@ -198,6 +198,20 @@ describe('find/get({ fields }) — projection', () => { expect(reads).toBe(0) }) + it('projects a vector-leg find too — the ANSWER is uniform, only the cost is not', async () => { + // The seam hydrates the metadata and graph page paths. A vector or text leg + // builds its own entities, so those rows are trimmed after the integrity + // guard instead. That difference is a COST difference, and this pin exists + // so it can never quietly become an ANSWER difference. + const rows = await brain.find({ query: 'post', fields: ['title'], limit: 3 }) + for (const r of rows) { + const meta = (r.entity.metadata ?? {}) as Record + expect(Object.keys(meta)).toEqual(['title']) + expect(meta.body).toBeUndefined() + expect(r.entity.id).toBe(r.id) + } + }) + it('get({ fields }) projects a single row through the same seam', async () => { const full = await brain.get(ids[0]) const projected = await brain.get(ids[0], { fields: ['title', 'slug'] })