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