Sha256: 66f7d41c3ddd3878f0820d4d3efbcf9bc3ef525a63b2fd8e38b80317fcfcd772
Contents?: true
Size: 1.12 KB
Versions: 9
Compression:
Stored size: 1.12 KB
Contents
import { testActionSnapshotWithFixtures } from '@theforeman/test'; import API from 'foremanReact/API'; import { fetchAccountsStatus, startAccountStatusPolling, stopAccountStatusPolling, restartProcess, } from '../AccountListActions'; import { pollingProcessID, fetchAccountsStatusResponse, } from '../AccountList.fixtures'; import { accountID, activeTab } from '../../Dashboard/Dashboard.fixtures'; jest.mock('foremanReact/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
9 entries across 9 versions & 1 rubygems