Skip to content

Commit

Permalink
test(Transfer): add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchanz committed May 23, 2019
1 parent 29a858d commit 14c5550
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/transfer/index-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@ describe('Transfer', () => {
dragItem.simulate('dragStart');
dropItem.simulate('dragOver', { pageY: referenceY + 1 });
dropItem.simulate('drop');
dragItem.simulate('dragStart');
dropItem.simulate('dragOver', { pageY: referenceY + 1 });
dropItem.simulate('drop');
assert(sortCalled);
assert(findItemText(wrapper, 0, 0) === '0');
assert(findItemText(wrapper, 0, 1) === '2');
Expand Down Expand Up @@ -563,14 +566,14 @@ describe('Transfer', () => {
wrapper = mount(
<Transfer dataSource={dataSource} id="transfer-test" titles={['left', 'right']}/>
);
assert(wrapper.find('#transfer-test-panel-footer-left').length === 1)
assert(wrapper.find('#transfer-test-panel-footer-right').length === 1)
assert(wrapper.find('#transfer-test-panel-header-left').length === 1)
assert(wrapper.find('#transfer-test-panel-header-right').length === 1)
assert(wrapper.find('#transfer-test-panel-footer-left').length === 1);
assert(wrapper.find('#transfer-test-panel-footer-right').length === 1);
assert(wrapper.find('#transfer-test-panel-header-left').length === 1);
assert(wrapper.find('#transfer-test-panel-header-right').length === 1);
});

it('should disabled item not move', () => {
wrapper = mount(<Transfer mode="simple" defaultValue={0} dataSource={dataSource} />);
wrapper = mount(<Transfer mode="simple" defaultLeftChecked={0} defaultValue={0} value={['1', '2', '3']} dataSource={dataSource} />);
findFooter(wrapper, 0)
.find('a.next-transfer-panel-move-all')
.simulate('click');
Expand Down

0 comments on commit 14c5550

Please sign in to comment.