Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
refactor: update error messages and test descriptions in ModelFactory tests for clarity
dev-miro26b5b0be99de20
diff --git a/web-app/src/lib/__tests__/model-factory.test.ts b/web-app/src/lib/__tests__/model-factory.test.tsindex 28862d660..c611b789d 100644--- a/web-app/src/lib/__tests__/model-factory.test.ts+++ b/web-app/src/lib/__tests__/model-factory.test.ts@@ -222,7 +222,7 @@ describe('ModelFactory', () => {await expect(ModelFactory.createModel('apple/on-device', foundationModelsProvider)).rejects.toThrow(- 'The Foundation Models server binary is missing. Please reinstall Jan.'+ 'Apple Foundation Models are currently unavailable on this device.')})@@ -236,27 +236,22 @@ describe('ModelFactory', () => {)})- it('should throw when available but no session is found after start', async () => {+ it('should throw when available but model is not loaded after start', async () => {mockedInvoke.mockResolvedValueOnce('available') // check_foundation_models_availability- .mockResolvedValueOnce(null) // find_foundation_models_session+ .mockResolvedValueOnce(false) // is_foundation_models_loadedawait expect(ModelFactory.createModel('apple/on-device', foundationModelsProvider)).rejects.toThrow(- 'No running Foundation Models session. The server may have failed to start'+ 'No running Foundation Models session. The model may have failed to load — please check the logs.')})- it('should create a model when available and session exists', async () => {+ it('should create a model when available and model is loaded', async () => {mockedInvoke.mockResolvedValueOnce('available') // check_foundation_models_availability- .mockResolvedValueOnce({ // find_foundation_models_session- pid: 12345,- port: 9876,- model_id: 'apple/on-device',- api_key: 'test-session-key',- })+ .mockResolvedValueOnce(true) // is_foundation_models_loadedconst model = await ModelFactory.createModel('apple/on-device',@@ -269,7 +264,7 @@ describe('ModelFactory', () => {{})expect(mockedInvoke).toHaveBeenCalledWith(- 'plugin:foundation-models|find_foundation_models_session',+ 'plugin:foundation-models|is_foundation_models_loaded',{})})