Sha256: 4c7056e350185be6b703cc210e3f6c87c53b98f4f8b73f8488d38386c689b327
Contents?: true
Size: 689 Bytes
Versions: 3
Compression:
Stored size: 689 Bytes
Contents
import { testActionSnapshotWithFixtures } from '@theforeman/test'; import { API } from 'foremanReact/redux/API'; import { handleToggle } from '../IpsObfuscationSwitcherActions'; import { handleToggleResponse } from '../IpsObfuscationSwitcher.fixtures'; jest.mock('foremanReact/redux/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
3 entries across 3 versions & 1 rubygems