Sha256: 2ed610b458b957ff3d07587c58eb572871ad70fe66260f4d67fcf5953a384c1c
Contents?: true
Size: 725 Bytes
Versions: 3
Compression:
Stored size: 725 Bytes
Contents
import { testActionSnapshotWithFixtures } from '@theforeman/test'; import { API } from 'foremanReact/redux/API'; import { handleToggle } from '../ExcludePackagesSwitcherActions'; import { handleToggleResponse } from '../ExcludePackagesSwitcher.fixtures'; jest.mock('foremanReact/redux/API'); API.post.mockImplementation(async () => handleToggleResponse); const fixtures = { 'should handleToggle': () => handleToggle(), 'should invoke toast notification upon failure of handleToggle': () => { API.post.mockImplementationOnce(() => Promise.reject(new Error('test error')) ); return handleToggle(); }, }; describe('ExcludePackagesSwitcher actions', () => testActionSnapshotWithFixtures(fixtures));
Version data entries
3 entries across 3 versions & 1 rubygems