2018-11-01 14:43:48 +03:00
|
|
|
import React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
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';
|
|
|
|
|
2018-12-18 00:32:51 +03:00
|
|
|
describe('<ShortUrls />', () => {
|
2018-11-01 14:43:48 +03:00
|
|
|
let wrapper;
|
2018-12-18 00:32:51 +03:00
|
|
|
const SearchBar = () => '';
|
|
|
|
const ShortUrlsList = () => '';
|
2018-11-01 14:43:48 +03:00
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
const params = {
|
|
|
|
serverId: '1',
|
|
|
|
page: '1',
|
|
|
|
};
|
|
|
|
|
2018-12-18 00:32:51 +03:00
|
|
|
const ShortUrls = shortUrlsCreator(SearchBar, ShortUrlsList);
|
|
|
|
|
2018-11-01 14:43:48 +03:00
|
|
|
wrapper = shallow(<ShortUrls match={{ params }} shortUrlsList={{ data: [] }} />);
|
|
|
|
});
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|