shlink-web-client/test/short-urls/ShortUrls.test.tsx

27 lines
867 B
TypeScript
Raw Normal View History

import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
2018-12-18 00:32:51 +03:00
import shortUrlsCreator from '../../src/short-urls/ShortUrls';
2018-11-01 14:43:48 +03:00
import Paginator from '../../src/short-urls/Paginator';
import { ShortUrlsListProps } from '../../src/short-urls/ShortUrlsList';
2018-11-01 14:43:48 +03:00
2018-12-18 00:32:51 +03:00
describe('<ShortUrls />', () => {
let wrapper: ShallowWrapper;
const SearchBar = () => null;
const ShortUrlsList = () => null;
2018-11-01 14:43:48 +03:00
beforeEach(() => {
2018-12-18 00:32:51 +03:00
const ShortUrls = shortUrlsCreator(SearchBar, ShortUrlsList);
wrapper = shallow(
<ShortUrls {...Mock.all<ShortUrlsListProps>()} />,
);
2018-11-01 14:43:48 +03:00
});
afterEach(() => wrapper.unmount());
it('wraps a SearchBar, ShortUrlsList as Paginator', () => {
expect(wrapper.find(SearchBar)).toHaveLength(1);
expect(wrapper.find(ShortUrlsList)).toHaveLength(1);
expect(wrapper.find(Paginator)).toHaveLength(1);
});
});