Sha256: 53b5c8a2244c5ede25e62d582d3154d6831f563ba68645d4024cb6b10afc84fa

Contents?: true

Size: 1.45 KB

Versions: 50

Compression:

Stored size: 1.45 KB

Contents

import React from 'react';
import { shallow } from '@theforeman/test';
import AggregateStatus from './index';

jest.unmock('./index.js');

describe('AggregateStatus', () => {
  describe('has no data', () => {
    it('renders cards with no data', () => {
      const chartNumbers = shallow(<AggregateStatus statuses={{}} />);
      const success = chartNumbers.find('#success_count').text();
      const failed = chartNumbers.find('#failed_count').text();
      const pending = chartNumbers.find('#pending_count').text();
      const cancelled = chartNumbers.find('#cancelled_count').text();
      expect(success).toBe('');
      expect(failed).toBe('');
      expect(cancelled).toBe('');
      expect(pending).toBe('');
    });

    it('renders cards with props passed', () => {
      const statuses = {
        success: 19,
        failed: 20,
        cancelled: 31,
        pending: 3,
      };
      const chartNumbers = shallow(<AggregateStatus statuses={statuses} />);
      const success = chartNumbers.find('#success_count').text();
      const failed = chartNumbers.find('#failed_count').text();
      const pending = chartNumbers.find('#pending_count').text();
      const cancelled = chartNumbers.find('#cancelled_count').text();
      expect(success).toBe(statuses.success.toString());
      expect(failed).toBe(statuses.failed.toString());
      expect(cancelled).toBe(statuses.cancelled.toString());
      expect(pending).toBe(statuses.pending.toString());
    });
  });
});

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
foreman_remote_execution-8.1.2 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-8.1.1 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-8.1.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-7.2.2 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-7.2.1 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-7.2.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-5.0.8 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-8.0.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-7.1.1 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-7.1.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-7.0.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-5.0.7 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-5.0.6 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-6.2.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-5.0.5 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-6.1.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-5.0.4 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-5.0.3 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-6.0.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-5.0.2 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js