Skip to content

Commit

Permalink
Merge 2d42b57 into 24aa115
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenberger committed Dec 1, 2017
2 parents 24aa115 + 2d42b57 commit 618615d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 3 additions & 4 deletions lib/GridBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ import PropTypes from 'prop-types';
// configuration into the grid
const withGridTemplate = (GridTemplate) => {
const wrapper = (props) => {
const {children, columnConfigs, ...rest} = props;
const hasColumns = columnConfigs.filter(item=>!item.hide).length !== 0;
const hasObjects = props.objects.length !== 0;
const render = hasColumns || hasObjects;
const { children, columnConfigs, ...rest } = props;
const hasColumns = columnConfigs.some(item=>!item.hide);
const render = hasColumns;

return(
<div>
Expand Down
4 changes: 1 addition & 3 deletions test/GridTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,11 @@ describe('Grid render tests', function(){

});

xit('Should not render anything if there are objects but no columns', function(){
it('Should not render anything if there are objects but no columns', function(){
let grid = render(
<Grid objects={data} hideColumnsWithoutConfig/>
);
//TODO what should be rendered here?
expect(grid.toString()).be.equal('<div></div>');

});


Expand Down

0 comments on commit 618615d

Please sign in to comment.