Sha256: 6f9d360abc74ceadcfcd10534fd3aa31d97c970b5c1acbac9794a383f31f06ff

Contents?: true

Size: 1.58 KB

Versions: 59

Compression:

Stored size: 1.58 KB

Contents

import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
import {
  selectTasksDashboard,
  selectTime,
  selectQuery,
  selectTasksSummary,
  calcStoppedOther,
} from '../TasksDashboardSelectors';

const stoppedResult = {
  error: {
    total: 9,
    recent: 1,
  },
  warning: {
    total: 8,
    recent: 2,
  },
  success: {
    total: 7,
    recent: 3,
  },
  cancelled: {
    total: 5,
    recent: 3,
  },
  pending: {
    total: 11,
    recent: 4,
  },
};

const state = {
  foremanTasks: {
    tasksDashboard: {
      time: 'some-time',
      query: 'some-query',
      tasksSummary: {
        running: {
          recent: 3,
          total: 8,
        },
        paused: {
          recent: 2,
          total: 9,
        },
        stopped: {
          by_result: stoppedResult,
        },
        scheduled: {
          total: 6,
        },
      },
    },
  },
};

const fixtures = {
  'should select tasks-dashboard': () => selectTasksDashboard(state),
  'should select tasks-dashboard when state is empty': () =>
    selectTasksDashboard({}),
  'should select time': () => selectTime(state),
  'should select time when state is empty': () => selectTime({}),
  'should select query': () => selectQuery(state),
  'should select query when state is empty': () => selectQuery({}),
  'should select tasks-summary': () => selectTasksSummary(state),
  'should select tasks-summary when state is empty': () =>
    selectTasksSummary({}),
  'should calcStoppedOther': () => calcStoppedOther(stoppedResult),
};

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

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
foreman-tasks-10.0.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-10.0.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-10.0.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.2.3 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.2.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.2.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.2.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.1.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.0.4 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.1.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.0.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.0.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-8.3.3 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-9.0.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-8.2.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-8.1.4 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-8.3.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-8.3.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-8.1.3 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js
foreman-tasks-8.3.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test.js