|
|
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); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|