Sha256: 03aca47320787441b71c685698f13e0a24c9758d6d172e708c4df8eadf3f4c1e

Contents?: true

Size: 1.58 KB

Versions: 61

Compression:

Stored size: 1.58 KB

Contents

import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
import {
  selectActionText,
  selectActionState,
  selectActionType,
  selectSelectedTasks,
  selectSelectedRowsLen,
} from '../ConfirmModalSelectors';
import { CANCEL_MODAL } from '../../../TasksTableConstants';

const state = {
  foremanTasks: {
    confirmModal: {
      actionText: 'some-text',
      actionState: 'some-state',
      actionType: 'some-type',
    },
    tasksTable: {
      tasksTableContent: {
        results: [
          {
            id: 1,
            action: 'action1',
            available_actions: { cancellable: true },
            can_edit: true,
          },
          { id: 2, action: 'action2', available_actions: { resumable: true } },
        ],
        itemCount: 10,
      },
      tasksTableQuery: { selectedRows: [1, 2, 3] },
    },
  },
};

const fixtures = {
  'should select actionText': () => selectActionText(state),
  'should select actionState': () => selectActionState(state),
  'should select actionType': () => selectActionType(state),
  'should select selectedTasks': () => selectSelectedTasks(state),
  'should select selectedRowsLen 1': () =>
    selectSelectedRowsLen({
      ...state,
      foremanTasks: { confirmModal: { actionType: CANCEL_MODAL } },
    }),
  'should select selectedRowsLen all': () => selectSelectedRowsLen(state),
  'should select selectedRowsLen some': () =>
    selectSelectedRowsLen({
      ...state,
      tasksTable: { tasksTableQuery: { allRowsSelected: true } },
    }),
};

describe('TasksDashboard - Selectors', () =>
  testSelectorsSnapshotWithFixtures(fixtures));

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
foreman-tasks-8.1.2 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-8.1.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-8.1.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-8.0.2 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-8.0.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-8.0.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-7.2.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-7.1.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-7.2.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-7.1.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-6.0.3 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-7.0.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-6.0.2 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-4.1.6 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-5.2.3 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-6.0.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-5.2.2 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-6.0.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-5.2.1 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js
foreman-tasks-5.3.0 webpack/ForemanTasks/Components/TasksTable/Components/ConfirmModal/__test__/ConfirmModalSelectors.test.js