File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import ReactTestUtils from 'react/lib/ReactTestUtils' ;
3
+ import Row from '../src/Row' ;
4
+
5
+ describe ( 'Row' , function ( ) {
6
+ it ( 'uses "div" by default' , function ( ) {
7
+ let instance = ReactTestUtils . renderIntoDocument (
8
+ < Row />
9
+ ) ;
10
+
11
+ assert . equal ( React . findDOMNode ( instance ) . nodeName , 'DIV' ) ;
12
+ } ) ;
13
+
14
+ it ( 'has "row" class' , function ( ) {
15
+ let instance = ReactTestUtils . renderIntoDocument (
16
+ < Row > Row content</ Row >
17
+ ) ;
18
+ assert . equal ( React . findDOMNode ( instance ) . className , 'row' ) ;
19
+ } ) ;
20
+
21
+ it ( 'Should merge additional classes passed in' , function ( ) {
22
+ let instance = ReactTestUtils . renderIntoDocument (
23
+ < Row className = "bob" />
24
+ ) ;
25
+ assert . ok ( React . findDOMNode ( instance ) . className . match ( / \b b o b \b / ) ) ;
26
+ assert . ok ( React . findDOMNode ( instance ) . className . match ( / \b r o w \b / ) ) ;
27
+ } ) ;
28
+
29
+ it ( 'allows custom elements instead of "div"' , function ( ) {
30
+ let instance = ReactTestUtils . renderIntoDocument (
31
+ < Row componentClass = 'section' />
32
+ ) ;
33
+
34
+ assert . equal ( React . findDOMNode ( instance ) . nodeName , 'SECTION' ) ;
35
+ } ) ;
36
+ } ) ;
You can’t perform that action at this time.
0 commit comments