INTO-CPS-Association/DTaaS

View on GitHub
client/test/unit/routes/Library.test.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import * as React from 'react';
import Library from 'route/library/Library';
import { assetType } from 'route/library/LibraryTabData';
import AuthProvider from 'route/auth/AuthProvider';
import { mockURLforLIB } from 'test/__mocks__/global_mocks';
import {
  InitRouteTests,
  itDisplaysContentOfTabs,
  itHasCorrectURLOfTabsWithIframe,
  TabLabelURLPair,
} from 'test/unit/unit.testUtil';

const urlsByTabs: TabLabelURLPair[] = assetType.map((tab) => ({
  label: tab.label,
  url: mockURLforLIB,
}));

describe('Library with no props', () => {
  InitRouteTests(
    <AuthProvider>
      <Library />
    </AuthProvider>,
  );

  itDisplaysContentOfTabs(assetType);

  itHasCorrectURLOfTabsWithIframe(urlsByTabs);
});