Sha256: 79c5ba358dfba39ab9b0085338604df6493a97165c7efe98e39b697ddc1cf8b9

Contents?: true

Size: 798 Bytes

Versions: 66

Compression:

Stored size: 798 Bytes

Contents

import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';

import { selectUnassignedRoles } from '../AnsibleRolesSwitcherSelectors';
import { ansibleRolesShort } 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 fixtures = {
  'should return unassigned roles': () =>
    selectUnassignedRoles(stateFactory(state1)),
  'should return all roles when no roles assigned': () =>
    selectUnassignedRoles(stateFactory(state2)),
};

describe('AnsibleRolesSwitcherSelectors', () =>
  testSelectorsSnapshotWithFixtures(fixtures));

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
foreman_ansible-12.0.6 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-12.0.5 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-10.4.3 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-12.0.4 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-10.4.2 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-12.0.3 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-12.0.2 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-12.0.1 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-12.0.0 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-11.2.1 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-7.1.7 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-11.2.0 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-11.1.2 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-7.1.6 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-11.1.1 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-10.4.1 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-7.1.5 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-11.1.0 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-10.4.0 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-10.3.0 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js