Sha256: f6afadbf827b0bf1730b7585d47e38ee3ab2d24765a76b6a0eedfbae1fd2af17

Contents?: true

Size: 1.02 KB

Versions: 19

Compression:

Stored size: 1.02 KB

Contents

import groupedSubscriptions, { subOne, subTwo, subThree, subFour } from './SubscriptionsTable.fixtures';
import { buildTableRows } from '../SubscriptionsTableHelpers';

describe('Build Table Rows', () => {
  it('should display correct maxQuantity', () => {
    const availableQuantities = {
      1: 50,
      2: 50,
      3: -1,
      4: 100,
      5: 50,
    };

    const rows = [subOne, subTwo, subThree, subFour];

    expect(buildTableRows(groupedSubscriptions, availableQuantities, {}))
      .toEqual(rows);
  });

  it('should update quantities', () => {
    const availableQuantities = {
      1: 50,
      2: 50,
      3: -1,
      4: 100,
      5: 50,
    };

    const updatedQuantities = {
      1: 20,
      4: 150,
    };

    const rows = [
      { ...subOne, entitlementsChanged: true, quantity: 20 },
      subTwo,
      { ...subThree, entitlementsChanged: true, quantity: 150 },
      subFour,
    ];

    expect(buildTableRows(groupedSubscriptions, availableQuantities, updatedQuantities))
      .toEqual(rows);
  });
});

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
katello-3.13.4 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.13.3 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.13.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.13.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.13.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.13.0.rc2.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.13.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.12.3 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.12.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.13.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.12.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.11.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.12.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.12.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.12.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.11.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.11.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.11.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-3.11.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js