Sha256: bcda5ef12d51d5bb1483ba94d626e17b367a0e4c222421eea721b3738311f9fa
Contents?: true
Size: 1.03 KB
Versions: 33
Compression:
Stored size: 1.03 KB
Contents
import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils'; import { selectUnassignedRoles, selectAssignedRolesPage, } from '../AnsibleRolesSwitcherSelectors'; import { ansibleRolesShort, ansibleRolesLong, } from '../__fixtures__/ansibleRolesData.fixtures'; const stateFactory = obj => ({ foremanAnsible: { ansibleRolesSwitcher: obj, }, }); const state1 = { results: ansibleRolesShort, assignedRoles: [{ id: 2 }, { id: 4 }], }; const state2 = { results: ansibleRolesShort, assignedRoles: [], }; const state3 = { assignedRoles: ansibleRolesLong, assignedPagination: { page: 2, perPage: 5 }, }; const fixtures = { 'should return unassigned roles': () => selectUnassignedRoles(stateFactory(state1)), 'should return all roles when no roles assigned': () => selectUnassignedRoles(stateFactory(state2)), 'should return requested page': () => selectAssignedRolesPage(stateFactory(state3)), }; describe('AnsibleRolesSwitcherSelectors', () => testSelectorsSnapshotWithFixtures(fixtures));
Version data entries
33 entries across 33 versions & 1 rubygems