Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
Merge 9725e22 into 449459d
Browse files Browse the repository at this point in the history
  • Loading branch information
patorjk committed Sep 26, 2019
2 parents 449459d + 9725e22 commit e6d69fe
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mui-dt",
"version": "0.8.0",
"version": "0.8.2",
"description": "Datatables for React using Material-UI",
"main": "dist/index.js",
"files": [
Expand Down
13 changes: 9 additions & 4 deletions src/components/TableToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ export const defaultToolbarStyles = theme => ({
root: {},
left: {
flex: '1 1 auto',
overflow: 'hidden',
},
actions: {
flex: '1 1 auto',
//flex: '1 1 auto',
textAlign: 'right',
whiteSpace: 'nowrap',
},
titleRoot: {},
titleText: {},
titleText: {
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
minWidth: 0,
},
icon: {
'&:hover': {
color: theme.palette.primary.main,
Expand All @@ -52,11 +59,9 @@ export const defaultToolbarStyles = theme => ({
display: 'none',
},
left: {
// flex: "1 1 40%",
padding: '8px 0px',
},
actions: {
// flex: "1 1 60%",
textAlign: 'right',
},
},
Expand Down
13 changes: 13 additions & 0 deletions test/MUIDataTable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import MUIDataTable from '../src/MUIDataTable';
import TableFilterList from '../src/components/TableFilterList';
import TablePagination from '../src/components/TablePagination';
import TableToolbar from '../src/components/TableToolbar';
import TableToolbarSelect from '../src/components/TableToolbarSelect';
import textLabels from '../src/textLabels';
import Chip from '@material-ui/core/Chip';
import Cities from '../examples/component/cities';
Expand Down Expand Up @@ -530,6 +531,18 @@ describe('<MUIDataTable />', function() {
assert.lengthOf(actualResult, 0);
});

it('should not render select toolbar when disableSelectToolbar=true', () => {
const options = { disableSelectToolbar: true };
const shallowWrapper = shallow(<MUIDataTable columns={columns} data={data} options={options} />).dive();
const instance = shallowWrapper.instance();

// Simulate a selection
instance.selectRowUpdate('cell', { index: 0, dataIndex: 0 });

const actualResult = shallowWrapper.find(TableToolbarSelect);
assert.lengthOf(actualResult, 0);
});

it('should properly set internal filterList when calling filterUpdate method with type=checkbox', () => {
const shallowWrapper = shallow(<MUIDataTable columns={columns} data={data} />);
const table = shallowWrapper.dive();
Expand Down

0 comments on commit e6d69fe

Please sign in to comment.