Katello/katello

View on GitHub
webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/__snapshots__/SubscriptionsTable.test.js.snap

Summary

Maintainability
Test Coverage
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`subscriptions table should disable checkboxes for custom subscriptions 1`] = `
<div>
  <table
    class="table table-striped table-bordered table-hover pf-table-inline-edit table-fixed neat-table-cells"
  >
    <thead>
      <tr
        class=""
      >
        <th
          aria-label="Select all rows"
          class="table-view-pf-select"
        >
          <label
            class="control-label sr-only"
            for="selectAll"
          >
            Select all rows
          </label>
          <input
            id="selectAll"
            type="checkbox"
          />
        </th>
        <th
          class=""
        >
          Name
        </th>
        <th
          class=""
        >
          SKU
        </th>
        <th
          class=""
        >
          Contract
        </th>
        <th
          class=""
        >
          Start Date
        </th>
        <th
          class=""
        >
          End Date
        </th>
      </tr>
    </thead>
    <tbody>
      <tr
        class=""
      >
        <td
          class="table-view-pf-select"
        >
          <label
            class="control-label sr-only"
            for="select0"
          >
            Select row
          </label>
          <input
            id="select0"
            type="checkbox"
          />
        </td>
        <td>
          <a
            href="/subscriptions/3/"
          >
            zoo
          </a>
        </td>
        <td
          class=""
        >
          853987721546
        </td>
        <td
          class=""
        />
        <td
          class=""
        >
          2017-09-21 16:18:44 -0400
        </td>
        <td
          class=""
        >
          2047-09-14 15:18:44 -0500
        </td>
      </tr>
      <tr
        class=""
      >
        <td
          class="table-view-pf-select"
        >
          <label
            class="control-label sr-only"
            for="select1"
          >
            Select row
          </label>
          <input
            disabled=""
            id="select1"
            type="checkbox"
          />
        </td>
        <td>
          <a
            href="/subscriptions/4/"
          >
            hsdfhsdh
          </a>
        </td>
        <td
          class=""
        >
          947637693017
        </td>
        <td
          class=""
        />
        <td
          class=""
        >
          2017-09-25 17:54:36 -0400
        </td>
        <td
          class=""
        >
          2047-09-18 16:54:36 -0500
        </td>
      </tr>
    </tbody>
  </table>
  <div>
    MockPagination
  </div>
</div>
`;

exports[`subscriptions table should render a loading state 1`] = `
<SubscriptionsTable
  emptyState={Object {}}
  loadSubscriptions={[Function]}
  onDeleteSubscriptions={[Function]}
  onSelectedRowsChange={[Function]}
  onSubscriptionDeleteModalClose={[Function]}
  selectedRows={Array []}
  selectionEnabled={false}
  subscriptionDeleteModalOpen={false}
  subscriptions={
    Object {
      "availableQuantities": null,
      "itemCount": 0,
      "loading": true,
      "pagination": Object {
        "page": 0,
        "perPage": 20,
      },
      "quantitiesLoading": false,
      "results": Array [],
      "selectedTableColumns": Array [],
      "tableColumns": Array [],
      "task": undefined,
    }
  }
  tableColumns={
    Array [
      "id",
      "product_id",
      "contract_number",
      "start_date",
      "end_date",
    ]
  }
  toggleDeleteButton={[Function]}
  updateQuantity={[Function]}
>
  <LoadingState
    loading={true}
    loadingText="Loading"
    timeout={300}
  >
    <div
      className="loading-state"
    >
      <Spinner
        className=""
        inline={false}
        inverse={false}
        loading={true}
        size="lg"
      >
        <div
          className="spinner spinner-lg"
        />
      </Spinner>
      <p>
        Loading
      </p>
    </div>
  </LoadingState>
</SubscriptionsTable>
`;

exports[`subscriptions table should render a table 1`] = `
<div>
  <table
    class="table table-striped table-bordered table-hover pf-table-inline-edit table-fixed neat-table-cells"
  >
    <thead>
      <tr
        class=""
      >
        <th
          class=""
        >
          Name
        </th>
        <th
          class=""
        >
          SKU
        </th>
        <th
          class=""
        >
          Contract
        </th>
        <th
          class=""
        >
          Start Date
        </th>
        <th
          class=""
        >
          End Date
        </th>
      </tr>
    </thead>
    <tbody>
      <tr
        class=""
      >
        <td>
          <a
            href="/subscriptions/3/"
          >
            zoo
          </a>
        </td>
        <td
          class=""
        >
          853987721546
        </td>
        <td
          class=""
        />
        <td
          class=""
        >
          2017-09-21 16:18:44 -0400
        </td>
        <td
          class=""
        >
          2047-09-14 15:18:44 -0500
        </td>
      </tr>
      <tr
        class=""
      >
        <td>
          <a
            href="/subscriptions/4/"
          >
            hsdfhsdh
          </a>
        </td>
        <td
          class=""
        >
          947637693017
        </td>
        <td
          class=""
        />
        <td
          class=""
        >
          2017-09-25 17:54:36 -0400
        </td>
        <td
          class=""
        >
          2047-09-18 16:54:36 -0500
        </td>
      </tr>
    </tbody>
  </table>
  <div>
    MockPagination
  </div>
</div>
`;

exports[`subscriptions table should render an empty state 1`] = `
<div>
  EmptyState: {"header":"Yay empty state","description":"There is nothing to see here"}
</div>
`;

exports[`subscriptions table should render subscription name without hyperlink for grouped subscriptions 1`] = `
<div>
  <table
    class="table table-striped table-bordered table-hover pf-table-inline-edit table-fixed neat-table-cells"
  >
    <thead>
      <tr
        class=""
      >
        <th
          aria-label="Select all rows"
          class="table-view-pf-select"
        >
          <label
            class="control-label sr-only"
            for="selectAll"
          >
            Select all rows
          </label>
          <input
            disabled=""
            id="selectAll"
            type="checkbox"
          />
        </th>
        <th
          class=""
        >
          Name
        </th>
        <th
          class=""
        >
          SKU
        </th>
        <th
          class=""
        >
          Contract
        </th>
        <th
          class=""
        >
          Start Date
        </th>
        <th
          class=""
        >
          End Date
        </th>
      </tr>
    </thead>
    <tbody>
      <tr
        class=""
      >
        <td
          class="table-view-pf-select"
        >
          <span
            aria-hidden="true"
            class="fa fa-angle-right collapse-subscription-group-button"
          />
        </td>
        <td>
          hsdfhsdh
        </td>
        <td
          class=""
        >
          853987721546
        </td>
        <td
          class=""
        >
          NA
        </td>
        <td
          class=""
        >
          NA
        </td>
        <td
          class=""
        >
          NA
        </td>
      </tr>
    </tbody>
  </table>
  <div>
    MockPagination
  </div>
</div>
`;