From e193c700d62d0c62875306efd6172d2f5b07fe55 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 6 Jun 2021 18:54:55 +0200 Subject: [PATCH] Fixed TS error in App test --- test/App.test.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/App.test.tsx b/test/App.test.tsx index da1fda0b..1607a7b4 100644 --- a/test/App.test.tsx +++ b/test/App.test.tsx @@ -1,23 +1,36 @@ import { shallow, ShallowWrapper } from 'enzyme'; import { Route } from 'react-router-dom'; -import { identity } from 'ramda'; import { Mock } from 'ts-mockery'; +import { Alert } from 'reactstrap'; import { Settings } from '../src/settings/reducers/settings'; import appFactory from '../src/App'; describe('', () => { let wrapper: ShallowWrapper; const MainHeader = () => null; + const ShlinkVersions = () => null; beforeEach(() => { - const App = appFactory(MainHeader, () => null, () => null, () => null, () => null, () => null, () => null); + const App = appFactory(MainHeader, () => null, () => null, () => null, () => null, () => null, ShlinkVersions); - wrapper = shallow(()} />); + wrapper = shallow( + {}} + servers={{}} + settings={Mock.all()} + appUpdated={false} + resetAppUpdate={() => {}} + />, + ); }); afterEach(() => wrapper.unmount()); it('renders a header', () => expect(wrapper.find(MainHeader)).toHaveLength(1)); + it('renders versions', () => expect(wrapper.find(ShlinkVersions)).toHaveLength(1)); + + it('renders an Alert', () => expect(wrapper.find(Alert)).toHaveLength(1)); + it('renders app main routes', () => { const routes = wrapper.find(Route); const expectedPaths = [