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