Skip to content

Commit 6f5173c

Browse files
committed
Cover param matching in isActive
1 parent 3d985bf commit 6f5173c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modules/__tests__/isActive-test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ describe('isActive', function () {
8080
})
8181
})
8282
})
83+
84+
describe('with params', function () {
85+
it('is active when its params match', function (done) {
86+
render((
87+
<Router history={createHistory('/hello/ryan')}>
88+
<Route path="/hello/:name" />
89+
</Router>
90+
), node, function () {
91+
expect(this.router.isActive('/hello/ryan')).toBe(true)
92+
expect(this.router.isActive('/hello/michael')).toBe(false)
93+
done()
94+
})
95+
})
96+
})
8397
})
8498

8599
describe('nested routes', function () {

0 commit comments

Comments
 (0)