-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into issue-#552-app-header
Merged origin/develop
- Loading branch information
Showing
7 changed files
with
94 additions
and
21 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -80,7 +80,6 @@ export default { | |
}, | ||
avatar: { | ||
position: 'relative', | ||
float: 'left', | ||
marginRight: '8px' | ||
}, | ||
badge: { | ||
|
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 @@ | ||
/* eslint-env mocha */ | ||
/* eslint react/jsx-filename-extension: [0] */ | ||
import React from 'react'; | ||
import chai, { expect } from 'chai'; | ||
import { shallow } from 'enzyme'; | ||
import sinon from 'sinon'; | ||
import sinonChai from 'sinon-chai'; | ||
import AdminBadge from '../../src/admin-badge'; | ||
import getStyles from '../../src/admin-badge/get-styles'; | ||
|
||
chai.use(sinonChai); | ||
global.navigator = { userAgent: 'all' }; | ||
|
||
describe('AdminBadge', () => { | ||
const props = { | ||
style: {}, | ||
inverted: false, | ||
text: 'Admin', | ||
color: '#1BA6C4' | ||
}; | ||
|
||
it('should always render a span element', () => { | ||
const wrapper = shallow(<AdminBadge {...props} />).dive().dive(); | ||
|
||
expect(wrapper.find('span')).to.have.length(1); | ||
}); | ||
|
||
it('should pass the value of the text prop to the span element', () => { | ||
const wrapper = shallow(<AdminBadge {...props} />).dive().dive(); | ||
|
||
expect(wrapper.containsMatchingElement(<span>Admin</span>)).to.equal(true); | ||
}); | ||
|
||
it('should get root styles', () => { | ||
const spy = sinon.spy(getStyles, 'root'); | ||
|
||
shallow(<AdminBadge {...props} />, { context: { color: 'red' } }).dive().dive(); | ||
expect(spy).to.have.been.calledWith(props.color, props.inverted, props.style); | ||
}); | ||
}); |
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
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