synapse-admin/tests/Root.test.js
Manuel Stahl 00d6959927 Create synapse-admin using 'rekit create --sass synapse-admin'
Change-Id: I14a94754264c83faffb7fea5099d37c97e60b07a
2019-03-11 17:06:04 +01:00

31 lines
897 B
JavaScript

import React from 'react';
import { shallow } from 'enzyme';
import configStore from '../src/common/configStore';
import Root from '../src/Root';
describe('Root', () => {
it('Root has no error', () => {
const DumpContainer = () => <div className="container">{this.props.children}</div>;
const NotFoundComp = () => <div className="not-found">Not found</div>;
const routes = [{
childRoutes: [
{ path: '/', component: DumpContainer, childRoutes: [{ path: 'abc' }] },
{ path: '/root', autoIndexRoute: true },
{ path: 'relative-path', name: 'Link Name' },
{
path: 'sub-links',
childRoutes: [
{ path: 'sub-link' },
],
},
{ path: '*', component: NotFoundComp },
],
}];
const store = configStore();
shallow(
<Root store={store} routeConfig={routes} />
);
});
});