2020-08-30 20:45:17 +03:00
|
|
|
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';
|
2020-08-30 20:45:17 +03:00
|
|
|
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 />', () => {
|
2020-08-30 20:45:17 +03:00
|
|
|
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);
|
|
|
|
|
2020-08-30 20:45:17 +03:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|