integration test fixes

This commit is contained in:
2025-12-23 16:32:05 -08:00
parent 921c48fc57
commit ae7afaaf97
11 changed files with 52 additions and 46 deletions

View File

@@ -282,15 +282,15 @@ describe('AI API Client (Network Mocking with MSW)', () => {
});
describe('searchWeb', () => {
it('should send items as JSON in the body', async () => {
const items = [createMockFlyerItem({ item: 'search me' })];
await aiApiClient.searchWeb(items, undefined, 'test-token');
it('should send query as JSON in the body', async () => {
const query = 'search me';
await aiApiClient.searchWeb(query, undefined, 'test-token');
expect(requestSpy).toHaveBeenCalledTimes(1);
const req = requestSpy.mock.calls[0][0];
expect(req.endpoint).toBe('search-web');
expect(req.body).toEqual({ items });
expect(req.body).toEqual({ query });
expect(req.headers.get('Authorization')).toBe('Bearer test-token');
});
});