Skip to content

Commit

Permalink
Clean up tests a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
taion committed Jun 16, 2017
1 parent 8a6bac8 commit 2601b98
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions test/ResolverUtils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ describe('ResolverUtils', () => {
});

describe.skip('getRouteMatches', () => {
it('untested');
test('untested');
});

describe.skip('getRouteValues', () => {
it('untested');
test('untested');
});

describe.skip('getComponents', () => {
it('untested');
test('untested');
});
});
23 changes: 12 additions & 11 deletions test/server/RouterProvider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,24 @@ describe('<RouterProvider>', () => {
});

it('should pass router to children cotext', () => {
let routerInContext;
const Child = class extends React.Component { // eslint-disable-line react/prefer-stateless-function
static contextTypes = {
router: routerShape.isRequired,
};

render() {
routerInContext = this.context.router;
return <div />;
}
let contextRouter;

const contextTypes = {
router: routerShape.isRequired,
};

function Child(props, context) {
contextRouter = context.router;
return null;
}

Child.contextTypes = contextTypes;

mount(
<RouterProvider router={router}>
<Child />
</RouterProvider>,
);
expect(routerInContext).toBeDefined();
expect(contextRouter).toBeDefined();
});
});

0 comments on commit 2601b98

Please sign in to comment.