Sha256: 70f2bb0760cc5a264a39724933e4cdf744193fba3be0e41de96ad63bef2fd5d1
Contents?: true
Size: 645 Bytes
Versions: 85
Compression:
Stored size: 645 Bytes
Contents
import { testActionSnapshotWithFixtures } from '@theforeman/test'; import { API } from 'foremanReact/redux/API'; import { fetchHits } from '../InsightsTabActions'; import { hostID, hits } from './InsightsTab.fixtures'; jest.mock('foremanReact/redux/API'); API.get.mockImplementation(async () => ({ data: { hits } })); const fixtures = { 'should fetchHits': () => fetchHits(hostID), 'should fetchHits with error': () => { API.get.mockImplementationOnce(() => Promise.reject(new Error('Network error!')) ); return fetchHits(hostID); }, }; describe('InsightsTab actions', () => testActionSnapshotWithFixtures(fixtures));
Version data entries
85 entries across 85 versions & 1 rubygems