From 7be9dd0da8cb5a89eeba074e17aba7b7977bcda2 Mon Sep 17 00:00:00 2001 From: Artemiy Vereshchinskiy Date: Tue, 29 Sep 2020 11:27:53 +0300 Subject: [PATCH] fix(all): fixes tests import --- src/__tests__/test.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/__tests__/test.tsx b/src/__tests__/test.tsx index fbd28de..3b55fdc 100644 --- a/src/__tests__/test.tsx +++ b/src/__tests__/test.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { shallow, ShallowWrapper } from 'enzyme'; -import { MorefinityListLoader, MorefinityContainer, IMorefinityProps } from '../index'; +import { MorefinityListLoader, Morefinity, IMorefinityProps } from '../index'; import { useState } from 'react'; const mockedItemHeight = 30; @@ -36,8 +36,8 @@ const fetchItems = async ( }); }; -describe('', () => { - const MorefinityContainerTest = () => { +describe('', () => { + const MorefinityTest = () => { const [items, setItems] = useState<{ id: number; text: string }[]>([ { id: 0, @@ -53,18 +53,18 @@ describe('', () => { }; return (
- {items.map(itemRenderer)} - +
); }; - const container = shallow(); + const container = shallow(); let wrapper: ShallowWrapper; const useEffect = jest.spyOn(React, 'useEffect'); @@ -84,21 +84,21 @@ describe('', () => { }; test('should pass scrollOffset prop', () => { - expect(container.find(MorefinityContainer).props().scrollOffset).toBe(100); + expect(container.find(Morefinity).props().scrollOffset).toBe(100); }); test('should request items with start offset and limit from props', () => { mockUseEffect(); - wrapper = shallow(); + wrapper = shallow(); expect(props.onScrollEnd).toBeCalledTimes(0); }); test('container height should be equal to passed property', () => { - wrapper = shallow(); + wrapper = shallow(); expect(wrapper.find('div').props().height).toBe(props.height); }); - test('should render ', () => { + test('should render ', () => { expect(wrapper.length).toBe(1); });