mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
[test] test for RowSelectionWrapper#componentWillReceiveProps
This commit is contained in:
parent
ceebdf5a13
commit
d80ae13513
@ -68,7 +68,18 @@ describe('RowSelectionWrapper', () => {
|
||||
expect(wrapper.props().onAllRowsSelect).toBeDefined();
|
||||
});
|
||||
|
||||
describe('when selectRow.selected is defiend', () => {
|
||||
describe('componentWillReceiveProps', () => {
|
||||
const nextSelected = [0];
|
||||
const nextProps = { store: { selected: nextSelected } };
|
||||
|
||||
it('should update state.selectedRowKeys with next selected rows', () => {
|
||||
wrapper.instance().componentWillReceiveProps(nextProps);
|
||||
|
||||
expect(wrapper.state('selectedRowKeys')).toEqual(nextSelected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when selectRow.selected is defined', () => {
|
||||
beforeEach(() => {
|
||||
selectRow.mode = 'checkbox';
|
||||
selectRow.selected = [1, 3];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user