Sha256: e5067eab64720439d0667d009c775899ef59cf8194766d97f4c8b1a77fffa72b
Contents?: true
Size: 746 Bytes
Versions: 9
Compression:
Stored size: 746 Bytes
Contents
import { testActionSnapshotWithFixtures } from '@theforeman/test'; 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
9 entries across 9 versions & 1 rubygems