mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 09:30:31 +03:00
Fixed TS error in App test
This commit is contained in:
parent
bfeb282aa9
commit
e193c700d6
1 changed files with 16 additions and 3 deletions
|
@ -1,23 +1,36 @@
|
||||||
import { shallow, ShallowWrapper } from 'enzyme';
|
import { shallow, ShallowWrapper } from 'enzyme';
|
||||||
import { Route } from 'react-router-dom';
|
import { Route } from 'react-router-dom';
|
||||||
import { identity } from 'ramda';
|
|
||||||
import { Mock } from 'ts-mockery';
|
import { Mock } from 'ts-mockery';
|
||||||
|
import { Alert } from 'reactstrap';
|
||||||
import { Settings } from '../src/settings/reducers/settings';
|
import { Settings } from '../src/settings/reducers/settings';
|
||||||
import appFactory from '../src/App';
|
import appFactory from '../src/App';
|
||||||
|
|
||||||
describe('<App />', () => {
|
describe('<App />', () => {
|
||||||
let wrapper: ShallowWrapper;
|
let wrapper: ShallowWrapper;
|
||||||
const MainHeader = () => null;
|
const MainHeader = () => null;
|
||||||
|
const ShlinkVersions = () => null;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const App = appFactory(MainHeader, () => null, () => null, () => null, () => null, () => null, () => null);
|
const App = appFactory(MainHeader, () => null, () => null, () => null, () => null, () => null, ShlinkVersions);
|
||||||
|
|
||||||
wrapper = shallow(<App fetchServers={identity} servers={{}} settings={Mock.all<Settings>()} />);
|
wrapper = shallow(
|
||||||
|
<App
|
||||||
|
fetchServers={() => {}}
|
||||||
|
servers={{}}
|
||||||
|
settings={Mock.all<Settings>()}
|
||||||
|
appUpdated={false}
|
||||||
|
resetAppUpdate={() => {}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
afterEach(() => wrapper.unmount());
|
afterEach(() => wrapper.unmount());
|
||||||
|
|
||||||
it('renders a header', () => expect(wrapper.find(MainHeader)).toHaveLength(1));
|
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', () => {
|
it('renders app main routes', () => {
|
||||||
const routes = wrapper.find(Route);
|
const routes = wrapper.find(Route);
|
||||||
const expectedPaths = [
|
const expectedPaths = [
|
||||||
|
|
Loading…
Reference in a new issue