fix(suggest): route sous /api ET /proxy/api + tri prefix-first style YouTube
This commit is contained in:
@@ -155,6 +155,15 @@ try {
|
||||
expect(JSON.stringify(withoutWeb) === JSON.stringify(['dm', 'od', 'pt', 'ru', 'tw', 'yt']), `full registry fallback (got ${keys})`);
|
||||
});
|
||||
|
||||
await scenario('served under both /api and /proxy/api (front apiBase)', async () => {
|
||||
for (const prefix of ['/api', '/proxy/api']) {
|
||||
const res = await fetch(`${baseUrl}${prefix}/search/suggest?q=tutoriel&providers=yt&limit=3`);
|
||||
expect(res.status === 200, `expected 200 on ${prefix}, got ${res.status}`);
|
||||
const body = await res.json();
|
||||
expect(body.q === 'tutoriel' && Array.isArray(body.groups?.yt), `${prefix} returns suggest JSON`);
|
||||
}
|
||||
});
|
||||
|
||||
await scenario('no duplicate occurrence across groups (web enrichment included)', async () => {
|
||||
const res = await fetch(`${baseUrl}/api/search/suggest?q=tutoriel&limit=10`);
|
||||
expect(res.status === 200, `expected 200, got ${res.status}`);
|
||||
|
||||
Reference in New Issue
Block a user