Sha256: ca55c302e200bcff7147406bde90d0c09004ab8c9e1eea1cf6093000c9d429b1
Contents?: true
Size: 629 Bytes
Versions: 9
Compression:
Stored size: 629 Bytes
Contents
import { testActionSnapshotWithFixtures } from '@theforeman/test'; 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
9 entries across 9 versions & 1 rubygems