Sha256: b1425bc9bc85ca548343672bb3df194d486b450b826673f3e3115ad1b91168ed
Contents?: true
Size: 752 Bytes
Versions: 10
Compression:
Stored size: 752 Bytes
Contents
import { testActionSnapshotWithFixtures } from 'react-redux-test-utils'; import API from 'foremanReact/API'; import { handleToggle } from '../AutoUploadSwitcherActions'; import { handleToggleResponse, currentAutoUploadEnabled, } from '../AutoUploadSwitcher.fixtures'; jest.mock('foremanReact/API'); API.post.mockImplementation(async () => handleToggleResponse); const fixtures = { 'should handleToggle': () => handleToggle(currentAutoUploadEnabled), 'should handleToggle with error': () => { API.post.mockImplementationOnce(() => Promise.reject(new Error('Network error!')) ); return handleToggle(currentAutoUploadEnabled); }, }; describe('AutoUploadSwitcher actions', () => testActionSnapshotWithFixtures(fixtures));
Version data entries
10 entries across 10 versions & 1 rubygems