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

25 lines
748 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';
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 and ShortUrlsList', () => {
2018-11-01 14:43:48 +03:00
expect(wrapper.find(SearchBar)).toHaveLength(1);
expect(wrapper.find(ShortUrlsList)).toHaveLength(1);
});
});