-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
Empty file.
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
Empty file.
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,26 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import NavBar from '../NavBar'; | ||
|
||
describe('Tests for <NavBar />', () => { | ||
it('should render', () => { | ||
const wrapper = shallow(<NavBar />); | ||
expect(wrapper.dive().find('div').length).toBe(1); | ||
}); | ||
it('should contain LogIn button by default', () => { | ||
const wrapper = shallow(<NavBar />); | ||
expect(wrapper.dive().contains('login')).toBe(true); | ||
}); | ||
it('should not contain Leader Board by default', () => { | ||
const wrapper = shallow(<NavBar />); | ||
expect(wrapper.dive().contains('Leader Board')).toBe(false); | ||
}); | ||
it('should not contain LogIn button if user has already logged in', () => { | ||
const wrapper = shallow(<NavBar isLoggedIn />); | ||
expect(wrapper.dive().contains('login')).toBe(false); | ||
}); | ||
it('should contain Leader Board by default', () => { | ||
const wrapper = shallow(<NavBar isLoggedIn />); | ||
expect(wrapper.dive().contains('Leader Board')).toBe(true); | ||
}); | ||
}); |