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.
4545~~~ js
4646
4747modifyId ({hidden, value, key, row}){
48- // row is the current row object
4948 return < a href= {value}> {value}< / a>
5049}
5150
@@ -70,10 +69,11 @@ modifyAll={this.modify}
7069###hide
7170
7271``` 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
7575}
76- Test (< Table rows= {[{id: 1 , name: ' zach' }]} hide= {[' id' ]}/ > )
76+ Test (< Table rows= {[{id: 1 , name: ' zach' }]} hide= {[' id' ]} modifyAll = {modify} / > )
7777.find (' td' )
7878.element (td => {
7979 expect (td .props .children ).to .be .equal (' zach' );
Original file line number Diff line number Diff line change 11{
22 "name" : " react-legit-table" ,
3- "version" : " 0.4.0 " ,
3+ "version" : " 0.4.1 " ,
44 "description" : " the simplest table component out there" ,
55 "main" : " lib/table.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -75,10 +75,11 @@ describe('Table component', () => {
7575 } )
7676
7777 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
8081 }
81- Test ( < Table rows = { [ { id : 1 , name : 'zach' } ] } hide = { [ 'id' ] } /> )
82+ Test ( < Table rows = { [ { id : 1 , name : 'zach' } ] } hide = { [ 'id' ] } modifyAll = { modify } /> )
8283 . find ( 'td' )
8384 . element ( td => {
8485 expect ( td . props . children ) . to . be . equal ( 'zach' ) ;
You can’t perform that action at this time.
0 commit comments