Sha256: d37a6b099e144f650f36c19047316cd2b10f6e02c7106973900aad0a56fe04df

Contents?: true

Size: 1.44 KB

Versions: 26

Compression:

Stored size: 1.44 KB

Contents

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

import {
  selectHostId,
  selectIsLoading,
  selectBootdiskOptions,
} from '../HostBootdiskButtonsSelectors';

import {
  HOST_DETAILS_REQUEST_KEY,
  HOST_BOOTDISK_BUTTONS_REQUEST_KEY,
} from '../../constants';

const stateFactory = (bootdiskState, hostState) => ({
  API: {
    [HOST_DETAILS_REQUEST_KEY]: {
      response: {
        ...hostState,
      },
    },
    [HOST_BOOTDISK_BUTTONS_REQUEST_KEY]: {
      response: {
        ...bootdiskState,
      },
    },
  },
});

const state = stateFactory(
  {
    bootdiskOptions: {
      bootdiskDownloadable: true,
      architectureName: 'x86_64',
      actions: [
        {
          title: "Host 'sppup' image",
          link: '/bootdisk/disks/hosts/8',
          disabled: false,
          description: null,
        },
        {
          title: "Full host 'sppup' image",
          link: '/bootdisk/disks/full_hosts/8',
          disabled: true,
          description: 'Host is not in build mode',
        },
        {
          title: 'Boot disk help',
          link: '/bootdisk/disks/help',
        },
      ],
    },
  },
  {
    id: 8,
  }
);

const fixtures = {
  'should return options': () => selectBootdiskOptions(state),
  'should return isLoading': () => selectIsLoading(state),
  'should return hostId': () => selectHostId(state),
};

describe('HostBootdiskButtons selectors', () =>
  testSelectorsSnapshotWithFixtures(fixtures));

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foreman_bootdisk-19.0.5 webpack/src/extensions/host/__tests__/HostBootdiskButtonsSelectors.test.js
foreman_bootdisk-19.0.4 webpack/src/extensions/host/__tests__/HostBootdiskButtonsSelectors.test.js
foreman_bootdisk-19.0.3 webpack/src/extensions/host/__tests__/HostBootdiskButtonsSelectors.test.js
foreman_bootdisk-19.0.2 webpack/src/extensions/host/__tests__/HostBootdiskButtonsSelectors.test.js
foreman_bootdisk-19.0.1 webpack/src/extensions/host/__tests__/HostBootdiskButtonsSelectors.test.js
foreman_bootdisk-19.0.0 webpack/src/extensions/host/__tests__/HostBootdiskButtonsSelectors.test.js