Skip to content

Commit f738595

Browse files
committed
Fix failing tests, warnings
1 parent 6dbd00a commit f738595

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

modules/components/__tests__/DefaultRoute-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ var NullHandler = React.createClass({
1212
}
1313
});
1414

15+
afterEach(require('../../stores/PathStore').teardown);
16+
1517
describe('A DefaultRoute', function () {
1618

1719
it('has a null path', function () {
@@ -65,7 +67,7 @@ describe('when no child routes match a URL, but the parent\'s path matches', fun
6567
var component, rootRoute, defaultRoute;
6668
beforeEach(function () {
6769
component = ReactTestUtils.renderIntoDocument(
68-
Routes({ location: 'none' },
70+
Routes({ location: 'none', initialPath: '/users/5' },
6971
rootRoute = Route({ name: 'user', path: '/users/:id', handler: NullHandler },
7072
Route({ name: 'home', path: '/users/:id/home', handler: NullHandler }),
7173
// Make it the middle sibling to test order independence.

modules/components/__tests__/Link-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ var Link = require('../Link');
99

1010
describe('A Link', function () {
1111

12+
afterEach(require('../../stores/PathStore').teardown);
13+
1214
describe('with params and a query', function () {
1315
var HomeHandler = React.createClass({
1416
render: function () {
@@ -19,7 +21,7 @@ describe('A Link', function () {
1921
var component;
2022
beforeEach(function () {
2123
component = ReactTestUtils.renderIntoDocument(
22-
Routes({ location: 'history', initialPath: '/mjackson/home' },
24+
Routes({ location: 'none', initialPath: '/mjackson/home' },
2325
Route({ name: 'home', path: '/:username/home', handler: HomeHandler })
2426
)
2527
);
@@ -45,7 +47,7 @@ describe('A Link', function () {
4547
var component;
4648
beforeEach(function () {
4749
component = ReactTestUtils.renderIntoDocument(
48-
Routes(null,
50+
Routes({ location: 'none', initialPath: '/' },
4951
DefaultRoute({ name: 'home', handler: HomeHandler })
5052
)
5153
);

modules/components/__tests__/NotFoundRoute-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('when no child routes match a URL, but the beginning of the parent\'s p
6565
var component, rootRoute, notFoundRoute;
6666
beforeEach(function () {
6767
component = ReactTestUtils.renderIntoDocument(
68-
Routes({ location: 'none' },
68+
Routes({ location: 'none', initialPath: '/users/5' },
6969
rootRoute = Route({ name: 'user', path: '/users/:id', handler: NullHandler },
7070
Route({ name: 'home', path: '/users/:id/home', handler: NullHandler }),
7171
// Make it the middle sibling to test order independence.

modules/components/__tests__/Routes-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('A Routes', function () {
2121
var component;
2222
beforeEach(function () {
2323
component = ReactTestUtils.renderIntoDocument(
24-
Routes(null,
24+
Routes({ location: 'none' },
2525
Route({ handler: NullHandler },
2626
Route({ path: '/a/b/c', handler: NullHandler })
2727
)
@@ -47,7 +47,7 @@ describe('A Routes', function () {
4747
var component;
4848
beforeEach(function () {
4949
component = ReactTestUtils.renderIntoDocument(
50-
Routes(null,
50+
Routes({ location: 'none' },
5151
Route({ handler: NullHandler },
5252
Route({ path: '/posts/:id/edit', handler: NullHandler })
5353
)

modules/mixins/__tests__/LocationContext-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ var LocationContext = require('../LocationContext');
77

88
describe('LocationContext', function () {
99

10+
afterEach(require('../../stores/PathStore').teardown);
11+
1012
var App = React.createClass({
1113
mixins: [ LocationContext ],
1214
render: function () {

modules/mixins/__tests__/Navigation-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ var Navigation = require('../Navigation');
88

99
describe('Navigation', function () {
1010

11+
afterEach(require('../../stores/PathStore').teardown);
12+
1113
var NavigationHandler = React.createClass({
1214
mixins: [ Navigation ],
1315
render: function () {

0 commit comments

Comments
 (0)