Sha256: 530cc5a2c51f3cef09c19888dc37219e8f2a63a9348f33a18076ea92debe09bd
Contents?: true
Size: 1.13 KB
Versions: 86
Compression:
Stored size: 1.13 KB
Contents
import { testActionSnapshotWithFixtures } from '@theforeman/test'; import { API } from 'foremanReact/redux/API'; import { fetchAccountsStatus, startAccountStatusPolling, stopAccountStatusPolling, restartProcess, } from '../AccountListActions'; import { pollingProcessID, fetchAccountsStatusResponse, } from '../AccountList.fixtures'; import { accountID, activeTab } from '../../Dashboard/Dashboard.fixtures'; jest.mock('foremanReact/redux/API'); API.get.mockImplementation(async () => fetchAccountsStatusResponse); const fixtures = { 'should fetchAccountsStatus': () => fetchAccountsStatus(), 'should startAccountStatusPolling': () => startAccountStatusPolling(pollingProcessID), 'should stopAccountStatusPolling': () => stopAccountStatusPolling(pollingProcessID), 'should restartProcess': () => restartProcess(accountID, activeTab), 'should invoke toast notification upon failure': () => { API.post.mockImplementationOnce(() => Promise.reject(new Error('test error')) ); return restartProcess(accountID, activeTab); }, }; describe('AccountList actions', () => testActionSnapshotWithFixtures(fixtures));
Version data entries
86 entries across 86 versions & 1 rubygems