只捱宅
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
15 additions and
15 deletions
-
components/transfer/__tests__/index.test.js
|
|
@ -121,7 +121,7 @@ describe('Transfer', () => { |
|
|
|
selectedKeys={['a']} |
|
|
|
targetKeys={['a']} |
|
|
|
onChange={handleChange} |
|
|
|
/> |
|
|
|
/>, |
|
|
|
); |
|
|
|
wrapper |
|
|
|
.find(TransferOperation) |
|
|
@ -471,26 +471,26 @@ describe('Transfer', () => { |
|
|
|
|
|
|
|
it('should support onScroll', () => { |
|
|
|
const onScroll = jest.fn(); |
|
|
|
const component = mount( |
|
|
|
<Transfer |
|
|
|
{...listCommonProps} |
|
|
|
onScroll={onScroll} |
|
|
|
/>, |
|
|
|
); |
|
|
|
component.find('.ant-transfer-list').at(0).find('.ant-transfer-list-content').at(0).simulate('scroll'); |
|
|
|
const component = mount(<Transfer {...listCommonProps} onScroll={onScroll} />); |
|
|
|
component |
|
|
|
.find('.ant-transfer-list') |
|
|
|
.at(0) |
|
|
|
.find('.ant-transfer-list-content') |
|
|
|
.at(0) |
|
|
|
.simulate('scroll'); |
|
|
|
expect(onScroll).toHaveBeenLastCalledWith('left', expect.anything()); |
|
|
|
component.find('.ant-transfer-list').at(1).find('.ant-transfer-list-content').at(0).simulate('scroll'); |
|
|
|
component |
|
|
|
.find('.ant-transfer-list') |
|
|
|
.at(1) |
|
|
|
.find('.ant-transfer-list-content') |
|
|
|
.at(0) |
|
|
|
.simulate('scroll'); |
|
|
|
expect(onScroll).toHaveBeenLastCalledWith('right', expect.anything()); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should support rowKey is function', () => { |
|
|
|
expect(() => { |
|
|
|
mount( |
|
|
|
<Transfer |
|
|
|
{...listCommonProps} |
|
|
|
rowKey={record => record.key} |
|
|
|
/>, |
|
|
|
); |
|
|
|
mount(<Transfer {...listCommonProps} rowKey={record => record.key} />); |
|
|
|
}).not.toThrow(); |
|
|
|
}); |
|
|
|
|
|
|
|