Skip to content

Commit 1848df7

Browse files
gilesb2David Zukowski
authored andcommitted
fix(Header): fix always-passing test for links
1 parent 28f55d7 commit 1848df7

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tests/components/Header/Header.spec.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import { Header } from 'components/Header/Header'
3+
import classes from 'components/Header/Header.scss'
34
import { IndexLink, Link } from 'react-router'
45
import { shallow } from 'enzyme'
56

@@ -18,13 +19,20 @@ describe('(Component) Header', () => {
1819

1920
describe('Navigation links...', () => {
2021

21-
it('Should render an IndexLink to Home route', () => {
22-
expect(_wrapper.contains(<IndexLink to='/'/>)).to.equal.true
22+
it('Should render a Link to Home route', () => {
23+
expect(_wrapper.contains(
24+
<IndexLink activeClassName={classes.activeRoute} to='/'>
25+
Home
26+
</Link>
27+
)).to.be.true
2328
})
2429

25-
it('Should render an Link to Counter route)', () => {
26-
expect(_wrapper.contains(<Link to='/counter'/>)).to.equal.true
30+
it('Should render a Link to Counter route', () => {
31+
expect(_wrapper.contains(
32+
<Link activeClassName={classes.activeRoute} to='/counter'>
33+
Counter
34+
</Link>
35+
)).to.be.true
2736
})
28-
2937
})
3038
})

0 commit comments

Comments
 (0)