Sha256: 79c5ba358dfba39ab9b0085338604df6493a97165c7efe98e39b697ddc1cf8b9

Contents?: true

Size: 798 Bytes

Versions: 68

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

68 entries across 68 versions & 1 rubygems

Version Path
foreman_ansible-7.0.0 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-6.3.4 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-6.3.3 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-6.3.2 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-6.3.1 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-6.4.1 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-6.4.0 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js
foreman_ansible-6.3.0 webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js