diff --git a/web-app/src/services/__tests__/models.test.ts b/web-app/src/services/__tests__/models.test.ts index b648b2677..b783f6ab5 100644 --- a/web-app/src/services/__tests__/models.test.ts +++ b/web-app/src/services/__tests__/models.test.ts @@ -325,7 +325,10 @@ describe('models service', () => { expect(result).toEqual(mockRepoData) expect(fetch).toHaveBeenCalledWith( - 'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true' + 'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true', + { + headers: {}, + } ) }) @@ -341,19 +344,28 @@ describe('models service', () => { 'https://huggingface.co/microsoft/DialoGPT-medium' ) expect(fetch).toHaveBeenCalledWith( - 'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true' + 'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true', + { + headers: {}, + } ) // Test with domain prefix await fetchHuggingFaceRepo('huggingface.co/microsoft/DialoGPT-medium') expect(fetch).toHaveBeenCalledWith( - 'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true' + 'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true', + { + headers: {}, + } ) // Test with trailing slash await fetchHuggingFaceRepo('microsoft/DialoGPT-medium/') expect(fetch).toHaveBeenCalledWith( - 'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true' + 'https://huggingface.co/api/models/microsoft/DialoGPT-medium?blobs=true', + { + headers: {}, + } ) }) @@ -379,7 +391,10 @@ describe('models service', () => { expect(result).toBeNull() expect(fetch).toHaveBeenCalledWith( - 'https://huggingface.co/api/models/nonexistent/model?blobs=true' + 'https://huggingface.co/api/models/nonexistent/model?blobs=true', + { + headers: {}, + } ) })