Sha256: 5f30da9cf11fcae48e8c3160b3016cb53cf6c1947f5811b0cacddf8cf825761f

Contents?: true

Size: 1.6 KB

Versions: 79

Compression:

Stored size: 1.6 KB

Contents

import React from 'react';
import { renderWithRedux, patientlyWaitFor } from 'react-testing-lib-wrapper';

import { nockInstance, assertNockRequest } from '../../../test-utils/nockWrapper';
import api from '../../../services/api';
import SmartProxyContentTable from '../SmartProxyContentTable';

const smartProxyContentData = require('./SmartProxyContentResult.fixtures.json');

const smartProxyContentPath = api.getApiUrl('/capsules/1/content/sync');

const smartProxyContent = { ...smartProxyContentData };

const contentTable = <SmartProxyContentTable smartProxyId={1} />;

test('Can display Smart proxy content table', async (done) => {
  const detailsScope = nockInstance
    .get(smartProxyContentPath)
    .query(true)
    .reply(200, smartProxyContent);

  const { getByText, getAllByLabelText } = renderWithRedux(contentTable);
  await patientlyWaitFor(() => expect(getByText('Environment')).toBeInTheDocument());
  expect(getByText('Content view')).toBeInTheDocument();
  expect(getByText('Type')).toBeInTheDocument();
  expect(getByText('Last published')).toBeInTheDocument();
  expect(getByText('Repositories')).toBeInTheDocument();
  expect(getByText('Synced to smart proxy')).toBeInTheDocument();
  expect(getAllByLabelText('Details')[0]).toHaveAttribute('aria-expanded', 'false');
  getAllByLabelText('Details')[0].click();
  expect(getAllByLabelText('Details')[0]).toHaveAttribute('aria-expanded', 'true');
  expect(getByText('Library')).toBeInTheDocument();
  expect(getByText('Default Organization View')).toBeInTheDocument();
  expect(getByText('dev')).toBeInTheDocument();


  assertNockRequest(detailsScope, done);
});

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
katello-4.10.0 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.9.2 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.10.0.rc2 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.10.0.rc1 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.8.4 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.9.1 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.8.3 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.9.0 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.7.6 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.8.2 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.9.0.rc2 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.9.0.rc1 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.8.1 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.7.5 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.8.0 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.8.0.rc2 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.7.4 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.8.0.rc1 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.7.3 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js
katello-4.7.2 webpack/scenes/SmartProxy/__tests__/SmartProxyContentTest.js