Sha256: 756f3a91047904b8f753b47db8e43e1cb502641203d3c9ab288880f87c872ccb

Contents?: true

Size: 1.23 KB

Versions: 11

Compression:

Stored size: 1.23 KB

Contents

import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
import {
  TASKS_DASHBOARD_AVAILABLE_TIMES,
  TASKS_DASHBOARD_AVAILABLE_QUERY_STATES,
  TASKS_DASHBOARD_AVAILABLE_QUERY_MODES,
  TASKS_DASHBOARD_AVAILABLE_QUERY_RESULTS,
} from '../../../../TasksDashboardConstants';
import StoppedTasksCard from './StoppedTasksCard';

const { STOPPED } = TASKS_DASHBOARD_AVAILABLE_QUERY_STATES;
const { LAST } = TASKS_DASHBOARD_AVAILABLE_QUERY_MODES;
const { WEEK } = TASKS_DASHBOARD_AVAILABLE_TIMES;

const fixtures = {
  'render with minimal props': {},
  'render with props': {
    data: {
      error: { total: 9, last: 1 },
      warning: { total: 8, last: 2 },
      success: { total: 7, last: 3 },
    },
    time: WEEK,
  },
  'render selected': {
    query: { state: STOPPED },
  },
};

Object.values(TASKS_DASHBOARD_AVAILABLE_QUERY_RESULTS).forEach(result => {
  fixtures[`render ${result}-total selected`] = {
    query: {
      state: STOPPED,
      result,
    },
  };
  fixtures[`render ${result}-last selected`] = {
    time: WEEK,
    query: {
      state: STOPPED,
      result,
      mode: LAST,
      time: WEEK,
    },
  };
});

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
foreman-tasks-2.0.3 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-3.0.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-2.0.2 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-1.1.3 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-1.1.2 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-2.0.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-2.0.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-1.2.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-1.1.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-1.1.0 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js
foreman-tasks-1.0.1 webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js