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-5.1.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-5.0.1 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-5.0.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.8.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.5.6 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.5.5 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.5.4 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.7.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.5.3 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.5.2 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.5.1 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.6.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.5.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.4.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.3.1 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.3.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.2.3 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.2.2 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.2.1 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js
foreman_remote_execution-4.2.0 webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js