Sha256: 94944f4efe9e2855c095e293ed59d9ff236a29943086e6a9157bd9e08bb77f39
Contents?: true
Size: 673 Bytes
Versions: 9
Compression:
Stored size: 673 Bytes
Contents
import { testActionSnapshotWithFixtures } from '@theforeman/test'; import API from 'foremanReact/API'; import { handleToggle } from '../IpsObfuscationSwitcherActions'; import { handleToggleResponse } from '../IpsObfuscationSwitcher.fixtures'; jest.mock('foremanReact/API'); API.post.mockImplementation(async () => handleToggleResponse); const fixtures = { 'should handleToggle': () => handleToggle(false), 'should handleError': () => { API.post.mockImplementationOnce(() => Promise.reject(new Error('test error')) ); return handleToggle(false); }, }; describe('IpsObfuscationSwitcher actions', () => testActionSnapshotWithFixtures(fixtures));
Version data entries
9 entries across 9 versions & 1 rubygems