Skip to content

Commit

Permalink
chore: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kagawagao committed Sep 17, 2019
1 parent 1749195 commit ff6056a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/transfer/__tests__/index.test.js
Expand Up @@ -144,6 +144,18 @@ describe('Transfer', () => {
expect(handleSelectChange).toHaveBeenLastCalledWith(['a'], ['b']);
});

it('should not check checkbox when component disabled', () => {
const handleSelectChange = jest.fn();
const wrapper = mount(
<Transfer {...listCommonProps} disabled onSelectChange={handleSelectChange} />,
);
wrapper
.find(TransferItem)
.filterWhere(n => n.prop('item').key === 'a')
.simulate('click');
expect(handleSelectChange).not.toHaveBeenCalled();
});

it('should not check checkbox when click on disabled item', () => {
const handleSelectChange = jest.fn();
const wrapper = mount(<Transfer {...listCommonProps} onSelectChange={handleSelectChange} />);
Expand Down

0 comments on commit ff6056a

Please sign in to comment.