Skip to content

Commit e311a26

Browse files
committed
Update server rendering test
1 parent 1310feb commit e311a26

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

modules/__tests__/serverRendering-test.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import expect from 'expect';
22
import React from 'react';
3-
import { createLocation } from 'history';
4-
import Router from '../Router';
5-
import Link from '../Link';
3+
import createHistory from 'history/lib/createMemoryHistory';
4+
import createLocation from 'history/lib/createLocation';
5+
import RoutingContext from '../RoutingContext';
6+
import useRoutes from '../useRoutes';
67

7-
describe.skip('server rendering', function () {
8+
describe('server rendering', function () {
89
var Dashboard, DashboardRoute, routes;
910
beforeEach(function () {
1011
Dashboard = React.createClass({
@@ -28,11 +29,16 @@ describe.skip('server rendering', function () {
2829
});
2930

3031
it('works', function (done) {
32+
var history = useRoutes(createHistory)({ routes });
3133
var location = createLocation('/');
3234

33-
Router.run(routes, location, function (error, state) {
34-
var string = React.renderToString(<Router initialState={state} />);
35+
history.match(location, function (error, state) {
36+
var string = React.renderToString(
37+
<RoutingContext history={history} {...state} />
38+
);
39+
3540
expect(string).toMatch(/The Dashboard/);
41+
3642
done();
3743
});
3844
});

0 commit comments

Comments
 (0)