@@ -1780,6 +1780,24 @@ describe('csv', function() {
17801780 assert . equal ( wb . Sheets . Sheet1 [ '!ref' ] , "A1:B3" ) ;
17811781 } ) ;
17821782 } ) ;
1783+ it ( 'should handle skipHidden for rows if requested' , function ( ) {
1784+ var baseline = "1,2,3,\nTRUE,FALSE,,sheetjs\nfoo,bar,2/19/14,0.3\n,,,\nbaz,,qux,\n" ;
1785+ assert . equal ( X . utils . sheet_to_csv ( ws ) , baseline ) ;
1786+ ws [ "!rows" ] = [ null , { hidden :true } , null , null ] ;
1787+ assert . equal ( X . utils . sheet_to_csv ( ws ) , baseline ) ;
1788+ assert . equal ( X . utils . sheet_to_csv ( ws , { skipHidden :true } ) , "1,2,3,\nfoo,bar,2/19/14,0.3\n,,,\nbaz,,qux,\n" ) ;
1789+ delete ws [ "!rows" ] ;
1790+ } ) ;
1791+ it ( 'should handle skipHidden for columns if requested' , function ( ) {
1792+ var baseline = "1,2,3,\nTRUE,FALSE,,sheetjs\nfoo,bar,2/19/14,0.3\n,,,\nbaz,,qux,\n" ;
1793+ assert . equal ( X . utils . sheet_to_csv ( ws ) , baseline ) ;
1794+ ws [ "!cols" ] = [ null , { hidden :true } , null , null ] ;
1795+ assert . equal ( X . utils . sheet_to_csv ( ws ) , baseline ) ;
1796+ assert . equal ( X . utils . sheet_to_csv ( ws , { skipHidden :true } ) , "1,3,\nTRUE,,sheetjs\nfoo,2/19/14,0.3\n,,\nbaz,qux,\n" ) ;
1797+ ws [ "!cols" ] = [ { hidden :true } , null , null , null ] ;
1798+ assert . equal ( X . utils . sheet_to_csv ( ws , { skipHidden :true } ) , "2,3,\nFALSE,,sheetjs\nbar,2/19/14,0.3\n,,\n,qux,\n" ) ;
1799+ delete ws [ "!cols" ] ;
1800+ } ) ;
17831801 } ) ;
17841802} ) ;
17851803
0 commit comments