T-136: tests
This commit is contained in:
parent
70e6bd30bf
commit
46d4c59132
1 changed files with 19 additions and 0 deletions
|
|
@ -560,3 +560,22 @@ describe('read_knowledge QA: deterministic ranking and limit', () => {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('read_knowledge QA: limit cutting through a cross-source tie', () => {
|
||||
test('limit inside a same-id tie keeps library > findings > provider_caveats and counts only returned rows', async () => {
|
||||
const { port } = staticPort(
|
||||
[card('dup', { title: 'Basis risk' })],
|
||||
[finding('dup', { title: 'Basis risk' })],
|
||||
[caveat('dup', { dataset: 'basis_ds' })]
|
||||
);
|
||||
|
||||
const two = await call(port, { query: 'basis', limit: 2 });
|
||||
|
||||
expect(two.payload?.rows.map(r => `${r.source}:${r.id}`)).toEqual([
|
||||
'library:dup',
|
||||
'findings:dup',
|
||||
]);
|
||||
expect(two.payload?.sources).toEqual({ library: 1, findings: 1, provider_caveats: 0 });
|
||||
expect(two.payload?.rowCount).toBe(2);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue