Sha256: 289a947be8ac886fa5023502afdde61c9971d53665e5c1008856660ffc903382
Contents?: true
Size: 635 Bytes
Versions: 10
Compression:
Stored size: 635 Bytes
Contents
import { testActionSnapshotWithFixtures } from 'react-redux-test-utils'; import API from 'foremanReact/API'; import { fetchHits } from '../InsightsTabActions'; import { hostID, hits } from './InsightsTab.fixtures'; jest.mock('foremanReact/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
10 entries across 10 versions & 1 rubygems