File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ Optionally, use `modifyAll` to change every item.
45
45
~~~ js
46
46
47
47
modifyId ({hidden, value, key, row}){
48
- // row is the current row object
49
48
return < a href= {value}> {value}< / a>
50
49
}
51
50
@@ -70,10 +69,11 @@ modifyAll={this.modify}
70
69
###hide
71
70
72
71
``` js
73
- let modify = ({hidden}) => {
74
- expect (hidden .id ).to .be .equal (1 )
72
+ let modify = ({hidden, value}) => {
73
+ expect (hidden .id ).to .be .equal (1 )
74
+ return value
75
75
}
76
- Test (< Table rows= {[{id: 1 , name: ' zach' }]} hide= {[' id' ]}/ > )
76
+ Test (< Table rows= {[{id: 1 , name: ' zach' }]} hide= {[' id' ]} modifyAll = {modify} / > )
77
77
.find (' td' )
78
78
.element (td => {
79
79
expect (td .props .children ).to .be .equal (' zach' );
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-legit-table" ,
3
- "version" : " 0.4.0 " ,
3
+ "version" : " 0.4.1 " ,
4
4
"description" : " the simplest table component out there" ,
5
5
"main" : " lib/table.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -75,10 +75,11 @@ describe('Table component', () => {
75
75
} )
76
76
77
77
it ( 'should hide id row' , ( ) => {
78
- let modify = ( { hidden} ) => {
79
- expect ( hidden . id ) . to . be . equal ( 1 )
78
+ let modify = ( { hidden, value} ) => {
79
+ expect ( hidden . id ) . to . be . equal ( 1 )
80
+ return value
80
81
}
81
- Test ( < Table rows = { [ { id : 1 , name : 'zach' } ] } hide = { [ 'id' ] } /> )
82
+ Test ( < Table rows = { [ { id : 1 , name : 'zach' } ] } hide = { [ 'id' ] } modifyAll = { modify } /> )
82
83
. find ( 'td' )
83
84
. element ( td => {
84
85
expect ( td . props . children ) . to . be . equal ( 'zach' ) ;
You can’t perform that action at this time.
0 commit comments