Skip to content

Commit

Permalink
add a test ensuring a home route and other route works properly
Browse files Browse the repository at this point in the history
  • Loading branch information
quantizor committed Nov 10, 2018
1 parent abe839e commit f492f0e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components.spec.js
Expand Up @@ -30,6 +30,24 @@ describe('Router', () => {
expect(root.innerHTML).toContain('bar');
});

it('renders the correct route with a home route also present', () => {
render({
routes: [
{
path: '/',
render: () => <div>Home</div>,
},
{
path: '/foo',
render: () => <div>bar</div>,
},
],
url: 'http://foo.com/foo',
});

expect(root.innerHTML).toContain('bar');
});

it('renders a child component class with the current routing state', () => {
class Foo extends React.Component {
render() {
Expand Down

0 comments on commit f492f0e

Please sign in to comment.