Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
patorjk committed Nov 23, 2019
1 parent 55176a5 commit 4797b8c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server -d --progress --colors",
"test": "mocha --require @babel/register test/**/*.test.js",
"test": "cross-env NODE_ENV=test mocha --require @babel/register test/**/*.test.js",
"docs:dev": "next docs",
"docs:build": "cross-env NODE_ENV=production next build docs",
"docs:export": "next export docs -o docs/export",
Expand Down
2 changes: 1 addition & 1 deletion src/components/TableToolbarSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TableToolbarSelect extends React.Component {
) : (
<Tooltip title={textLabels.delete}>
<IconButton className={classes.iconButton} onClick={onRowsDelete} aria-label={textLabels.deleteAria}>
<DeleteIcon className={classes.deleteIcon} />
<DeleteIcon className={classes.deleteIcon} data-icon="DeleteIcon" />
</IconButton>
</Tooltip>
)}
Expand Down
2 changes: 1 addition & 1 deletion test/MUIDataTable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ describe('<MUIDataTable />', function() {

it('should recalculate page when calling changeRowsPerPage method', () => {
const mountWrapper = mount(
shallow(<MUIDataTable columns={columns} data={data} options={{ rowsPerPage: 2 }} />).get(0),
shallow(<MUIDataTable columns={columns} data={data} options={{ rowsPerPageOptions: [2], rowsPerPage: 2 }} />).get(0),
);
const instance = mountWrapper.instance();

Expand Down
3 changes: 1 addition & 2 deletions test/MUIDataTableToolbarSelect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { match, spy, stub } from 'sinon';
import { mount, shallow } from 'enzyme';
import { assert, expect, should } from 'chai';
import DeleteIcon from '@material-ui/icons/Delete';
import TableToolbarSelect from '../src/components/TableToolbarSelect';
import textLabels from '../src/textLabels';

Expand All @@ -15,7 +14,7 @@ describe('<TableToolbarSelect />', function() {
<TableToolbarSelect options={{ textLabels }} selectedRows={{ data: [1] }} onRowsDelete={onRowsDelete} />,
);

const actualResult = mountWrapper.find(DeleteIcon);
const actualResult = mountWrapper.find('svg[data-icon="DeleteIcon"]');
assert.strictEqual(actualResult.length, 1);
});

Expand Down

0 comments on commit 4797b8c

Please sign in to comment.