Sha256: 9bbb123322ebf9036843158c45b8ab4f5e44531578c3f9a46d636f7e5cab1c7d

Contents?: true

Size: 1.14 KB

Versions: 62

Compression:

Stored size: 1.14 KB

Contents

import { testActionSnapshotWithFixtures } from '@theforeman/test';
import { API } from 'foremanReact/redux/API';
import { timeToHoursNumber } from '../TasksDashboardHelper';
import {
  initializeDashboard,
  updateTime,
  updateQuery,
  fetchTasksSummary,
} from '../TasksDashboardActions';
import {
  correctTime,
  wrongTime,
  parentTaskID,
  apiGetMock,
} from './TaskDashboard.fixtures';

jest.mock('foremanReact/redux/API');
jest.mock('../TasksDashboardHelper');

timeToHoursNumber.mockImplementation(arg => arg);
API.get.mockImplementation(apiGetMock);

const fixtures = {
  'should initialize-dashboard': () =>
    initializeDashboard({ time: 'some-time', query: 'some-query' }),
  'should update-time': () => updateTime('some-time'),
  'should update-query': () => updateQuery('some-query'),
  'should fetch-tasks-summary and success': () =>
    fetchTasksSummary(correctTime),
  'should fetch-tasks-summary for subtasks and success': () =>
    fetchTasksSummary(correctTime, parentTaskID),
  'should fetch-tasks-summary and fail': () => fetchTasksSummary(wrongTime),
};

describe('TasksDashboard - Actions', () =>
  testActionSnapshotWithFixtures(fixtures));

Version data entries

62 entries across 62 versions & 1 rubygems

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