Download mui-datatables/test/MUIDataTableSelectCell.test.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/mui-datatables/test/MUIDataTableSelectCell.test.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/mui-datatables/test/MUIDataTableSelectCell.test.js
-
curl -L -o MUIDataTableSelectCell.test.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/mui-datatables/test/MUIDataTableSelectCell.test.js
1.68 kB
| import React from 'react'; | |
| import { spy, stub } from 'sinon'; | |
| import { mount, shallow } from 'enzyme'; | |
| import { assert, expect, should } from 'chai'; | |
| import Checkbox from '@mui/material/Checkbox'; | |
| import TableSelectCell from '../src/components/TableSelectCell'; | |
| describe('<TableSelectCell />', function() { | |
| before(() => {}); | |
| it('should render table select cell', () => { | |
| const mountWrapper = mount(<TableSelectCell checked={false} selectableOn={true} />); | |
| const actualResult = mountWrapper.find(Checkbox); | |
| assert.strictEqual(actualResult.length, 1); | |
| }); | |
| it('should render table select cell checked', () => { | |
| const mountWrapper = mount(<TableSelectCell checked={true} selectableOn={true} />); | |
| const actualResult = mountWrapper.find(Checkbox); | |
| assert.strictEqual(actualResult.props().checked, true); | |
| }); | |
| it('should render table select cell unchecked', () => { | |
| const mountWrapper = mount(<TableSelectCell checked={false} selectableOn={true} />); | |
| const actualResult = mountWrapper.find(Checkbox); | |
| assert.strictEqual(actualResult.props().checked, false); | |
| }); | |
| // it("should trigger onColumnUpdate prop callback when calling method handleColChange", () => { | |
| // const options = {}; | |
| // const onColumnUpdate = spy(); | |
| // const shallowWrapper = shallow( | |
| // <MUIDataTableViewCol | |
| // columns={columns} | |
| // onColumnUpdate={onColumnUpdate} | |
| // viewColStyles={defaultViewColStyles} | |
| // options={options} | |
| // />, | |
| // ).dive(); | |
| // const instance = shallowWrapper.instance(); | |
| // instance.handleColChange(0); | |
| // assert.strictEqual(onColumnUpdate.callCount, 1); | |
| // }); | |
| }); | |