Sha256: 74a080d60e675a72bd27f20451015f8c720ca8ed75767067188f133c7937485c
Contents?: true
Size: 1.39 KB
Versions: 100
Compression:
Stored size: 1.39 KB
Contents
import thunk from 'redux-thunk'; import Immutable from 'seamless-immutable'; import configureMockStore from 'redux-mock-store'; import { mockRequest, mockErrorRequest, mockReset } from '../../../mockRequest'; import { getAnsibleCollections } from '../AnsibleCollectionsActions'; import { ansibleCollectionsErrorActions, ansibleCollectionsSuccessActions, results, } from './AnsibleCollections.fixtures'; const mockStore = configureMockStore([thunk]); const store = mockStore({ ansibleCollections: Immutable({}) }); const endpoint = '/katello/api/v2/ansible_collections'; afterEach(() => { store.clearActions(); mockReset(); }); describe('ansible collections actions', () => { describe('getAnsibleCollections', () => { it( 'creates ANSIBLE_COLLECTIONS_REQUEST and then fails with 500 on bad request', async () => { mockErrorRequest({ url: endpoint, }); await store.dispatch(getAnsibleCollections()); expect(store.getActions()) .toEqual(ansibleCollectionsErrorActions); }, ); it( 'creates ANSIBLE_COLLECTIONS_REQUEST and then return successfully', async () => { mockRequest({ url: endpoint, response: results, }); await store.dispatch(getAnsibleCollections()); expect(store.getActions()) .toEqual(ansibleCollectionsSuccessActions); }, ); }); });
Version data entries
100 entries across 100 versions & 1 rubygems