/** * Integration test for store health analysis using mocks. */ const { getStoreHealth } = require('../../integrations/storeHealth'); // Mock the services jest.mock('../../services/meraki', () => require('../mocks/mockMeraki')); jest.mock('../../services/mdm', () => require('../mocks/mockMdm')); // SIW is required dynamically in the file, so we mock the whole module jest.mock('../../services/siw', () => require('../mocks/mockSiw')); describe('storeHealth integration (with mocks)', () => { it('returns a health summary with reasonable score for a known store', async () => { const result = await getStoreHealth('305'); expect(result).toHaveProperty('summary'); expect(result.summary).toContain('Store 305 Health Summary'); expect(result.summary).toContain('Overall Status'); }); it('handles missing Meraki network gracefully', async () => { // Store 999 does not exist in mock const result = await getStoreHealth('999'); expect(result.summary).toContain('No Meraki network found'); }); });