-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW Add hideNav flag to allow hiding of navigation in Tabs
- Loading branch information
1 parent
09cd3f1
commit a800ce7
Showing
3 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* global jest, describe, it, expect */ | ||
|
||
import React from 'react'; | ||
import Tabs from '../Tabs'; | ||
import Enzyme, { shallow } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-15.4/build/index'; | ||
|
||
Enzyme.configure({ adapter: new Adapter() }); | ||
|
||
describe('Tab', () => { | ||
describe('render()', () => { | ||
it('Renders the navigation with hideNav: false', () => { | ||
const wrapper = shallow( | ||
<Tabs | ||
id={'1'} | ||
hideNav={false} | ||
> | ||
<div title="Child One" /> | ||
<div title="Child Two" /> | ||
</Tabs> | ||
); | ||
|
||
expect(wrapper.find('Nav')).toHaveLength(1); | ||
}); | ||
|
||
it('Doesn\'t render the navigation with hideNav: true', () => { | ||
const wrapper = shallow( | ||
<Tabs | ||
id={'2'} | ||
hideNav | ||
> | ||
<div title="Child One" /> | ||
<div title="Child Two" /> | ||
</Tabs> | ||
); | ||
|
||
expect(wrapper.find('Nav')).toHaveLength(0); | ||
}); | ||
}); | ||
}); |