-
Notifications
You must be signed in to change notification settings - Fork 41
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
3 changed files
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
import React from 'react'; | ||
|
||
import filter from '../filter'; | ||
import Div from '../commons/div'; | ||
|
||
const defaultClassName = 'ui buttons'; | ||
const componentName = 'Buttons'; | ||
|
||
const Buttons = new filter(Div) | ||
.classGenerator(defaultClassName) | ||
.getComposeComponent(componentName); | ||
|
||
export default Buttons; |
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 @@ | ||
|
||
import ReactDOM from 'react-dom'; | ||
import React from 'react'; | ||
import TestUtils from 'react-addons-test-utils'; | ||
import {Buttons} from '../../../src/index'; | ||
|
||
describe('Buttons', () => { | ||
it('should have .ui.buttons class by default', () => { | ||
let instance = TestUtils.renderIntoDocument( | ||
<Buttons></Buttons> | ||
); | ||
|
||
expect(ReactDOM.findDOMNode(instance).className).toMatch('ui'); | ||
expect(ReactDOM.findDOMNode(instance).className).toMatch('buttons'); | ||
}); | ||
|
||
it('should have child by default', () => { | ||
let instance = TestUtils.renderIntoDocument( | ||
<Buttons>123</Buttons> | ||
); | ||
|
||
expect(ReactDOM.findDOMNode(instance).textContent).toEqual('123'); | ||
}); | ||
|
||
it('should have custom class with custom className', () => { | ||
let instance = TestUtils.renderIntoDocument( | ||
<Buttons className="custom"></Buttons> | ||
); | ||
|
||
expect(ReactDOM.findDOMNode(instance).className).toMatch('custom'); | ||
}); | ||
|
||
it('should display Buttons name', () => { | ||
let Component = ( | ||
<Buttons></Buttons> | ||
); | ||
|
||
expect(Component.type.displayName).toMatch('Buttons'); | ||
}); | ||
}); |