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

Version Path
foreman_rh_cloud-2.0.18.1 webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js
foreman_rh_cloud-2.0.18 webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js
foreman_rh_cloud-2.0.17 webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js
foreman_rh_cloud-2.0.16 webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js
foreman_rh_cloud-2.0.15 webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js
foreman_rh_cloud-3.0.14 webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js
foreman_rh_cloud-2.0.14 webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js
foreman_rh_cloud-2.0.13.1 webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js
foreman_rh_cloud-2.0.13 webpack/InsightsHostDetailsTab/__tests__/InsightsTabActions.test.js