Sha256: b88fc6ebf839ef0190b8c4e999d64573347e4a878ae281b2f5b35023063e2df9

Contents?: true

Size: 1.2 KB

Versions: 70

Compression:

Stored size: 1.2 KB

Contents

import { testComponentSnapshotsWithFixtures } from '@theforeman/test';

import { TASKS_DONUT_CHART_FOCUSED_ON_OPTIONS_ARRAY } from './TasksDonutChartConstants';
import TasksDonutChart from './TasksDonutChart';

jest.mock('./TasksDonutChartHelper', () => ({
  shouleBeSelected: focusedOn => focusedOn !== 'normal' && focusedOn !== 'none',
  getBaseChartConfig: jest.fn(() => ({ base: 'some-base-config' })),
  createChartData: jest.fn(() => ({
    columns: 'some-columns',
    names: 'some-names',
    onItemClick: jest.fn(),
  })),
  updateChartTitle: jest.fn(),
}));

const createRequiredProps = () => ({ last: 3, older: 5 });

const fixtures = {
  'render with minimal props': { ...createRequiredProps() },
  'render with props': {
    ...createRequiredProps(),
    className: 'some-class',
    time: 'time-period',
    colorsPattern: ['color1', 'color2'],
    onTotalClick: jest.fn(),
    onLastClick: jest.fn(),
    onOlderClick: jest.fn(),
  },
};

TASKS_DONUT_CHART_FOCUSED_ON_OPTIONS_ARRAY.forEach(mode => {
  fixtures[`render with focused-on ${mode}`] = {
    ...createRequiredProps(),
    focusedOn: mode,
  };
});

describe('TasksDonutChart', () =>
  testComponentSnapshotsWithFixtures(TasksDonutChart, fixtures));

Version data entries

70 entries across 70 versions & 1 rubygems

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