Sha256: 7029a52bfdb1eced68e9d826ee379736b39084f37c054a5d94be6991ad04fa31
Contents?: true
Size: 1.15 KB
Versions: 21
Compression:
Stored size: 1.15 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'; jest.mock('foremanReact/API'); API.get.mockImplementation(() => serverMock); const runWithGetState = (state, action, params) => dispatch => { const getState = () => ({ 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
21 entries across 21 versions & 2 rubygems