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