Sha256: 8bb49aadf7756a6234b57d921c9d7004eaf100f7261a3333a76a35e4360ae7b6
Contents?: true
Size: 1.23 KB
Versions: 19
Compression:
Stored size: 1.23 KB
Contents
import { testActionSnapshotWithFixtures } from 'react-redux-test-utils'; import API from 'foremanReact/API'; import { startPolling, stopPolling, fetchLogs, setActiveTab, downloadReports, toggleFullScreen, } from '../DashboardActions'; import { pollingProcessID, serverMock, activeTab, accountID, } from '../Dashboard.fixtures'; import { rhCloudStateWrapper } from '../../../../ForemanRhCloudTestHelpers'; jest.mock('foremanReact/API'); API.get.mockImplementation(() => serverMock); const runWithGetState = (state, action, params) => dispatch => { const getState = () => rhCloudStateWrapper({ dashboard: state }); action(params)(dispatch, getState); }; const fixtures = { 'should startPolling': () => startPolling(accountID, pollingProcessID), 'should fetchLogs': () => runWithGetState({ activeTab: 'uploads' }, fetchLogs, accountID), 'should stopPolling': () => stopPolling(accountID, pollingProcessID), 'should setActiveTab': () => setActiveTab(accountID, activeTab), 'should downloadReports': () => downloadReports(accountID), 'should toggleFullScreen': () => runWithGetState({ activeTab: 'reports' }, toggleFullScreen, accountID), }; describe('Dashboard actions', () => testActionSnapshotWithFixtures(fixtures));
Version data entries
19 entries across 19 versions & 1 rubygems