Sha256: c797f6096c507b40d1cb58066d8bc7d7af1ea949edba6ea494bbb337ec5fcd19

Contents?: true

Size: 1.41 KB

Versions: 17

Compression:

Stored size: 1.41 KB

Contents

import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
import {
  selectTasksDashboard,
  selectTime,
  selectQuery,
  selectTasksSummary,
} from '../TasksDashboardSelectors';

const state = {
  tasksDashboard: {
    time: 'some-time',
    query: 'some-query',
    tasksSummary: {
      running: {
        recent: 3,
        total: 8,
      },
      paused: {
        recent: 2,
        total: 9,
      },
      stopped: {
        by_result: {
          error: {
            total: 9,
            recent: 1,
          },
          warning: {
            total: 8,
            recent: 2,
          },
          success: {
            total: 7,
            recent: 3,
          },
        },
      },
      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({}),
};

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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
foreman-tasks-0.17.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.16.3 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.17.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.11 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.16.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.10 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.16.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.17.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.9 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.8 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.7 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.16.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.6 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.5 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.4 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.3 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js
foreman-tasks-0.15.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardSelectors.test..js