Skip to content

Commit

Permalink
Added tests for Route
Browse files Browse the repository at this point in the history
  • Loading branch information
chentsulin committed Nov 25, 2016
1 parent 1617e09 commit 547afc0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/jsx/__tests__/Route.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-disable import/no-extraneous-dependencies */

import React from 'react';
import {
renderIntoDocument,
} from 'react-addons-test-utils';

import Route from '../Route';


it('createRoute should return props directly', () => {
const App = () => <div>App</div>;
expect(Route.createRoute({
path: '/',
Component: App,
})).toEqual({
path: '/',
Component: App,
});
});

it('throw when be rendered', () => {
expect(
() => renderIntoDocument(<Route />)
).toThrowError(/should not be rendered/);
});

0 comments on commit 547afc0

Please sign in to comment.