Sha256: 22b228cae1f69d8b4dabdcba4764a8582ee41ff2253748092bbec317a5fd439b

Contents?: true

Size: 1.12 KB

Versions: 152

Compression:

Stored size: 1.12 KB

Contents

import groupedSubscriptions, { genericRow, subOneRowOne, subOneRowTwo, 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 = [genericRow, subOneRowOne, subOneRowTwo, 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 = [genericRow,
      { ...subOneRowOne, entitlementsChanged: true, quantity: 20 },
      subOneRowTwo,
      subTwo,
      { ...subThree, entitlementsChanged: true, quantity: 150 },
      subFour,
    ];

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

Version data entries

152 entries across 152 versions & 1 rubygems

Version Path
katello-4.14.2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.15.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.15.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.15.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.14.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.14.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.14.0.rc3 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.14.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.14.0.rc1.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.14.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.13.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.13.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.12.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.13.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.12.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.12.0.rc3 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.12.0.rc2 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.12.0.rc1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.11.1 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js
katello-4.11.0 webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTableHelpers.test.js