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-10.0.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-10.0.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.2.3 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.2.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.2.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.2.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.1.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.0.4 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.1.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.0.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.0.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-8.3.3 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-9.0.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-8.2.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-8.1.4 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-8.3.2 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-8.3.1 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-8.1.3 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-8.3.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js
foreman-tasks-8.2.0 webpack/ForemanTasks/Components/TasksDashboard/__tests__/TasksDashboardActions.test.js