mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
more test cases
This commit is contained in:
parent
93b14da4a6
commit
3a445f3e75
@ -83,4 +83,19 @@ describe('Modal.confirm triggers callbacks correctly', () => {
|
||||
expect($$('.ant-btn')).toHaveLength(1);
|
||||
expect($$('.ant-btn')[0].innerHTML).toContain('OK');
|
||||
});
|
||||
|
||||
it('trigger onCancel once when click on cancel button', () => {
|
||||
jest.useFakeTimers();
|
||||
['info', 'success', 'warning', 'error'].forEach((type) => {
|
||||
Modal[type]({
|
||||
title: 'title',
|
||||
content: 'content',
|
||||
});
|
||||
expect($$(`.ant-confirm-${type}`)).toHaveLength(1);
|
||||
$$('.ant-btn')[0].click();
|
||||
jest.runAllTimers();
|
||||
expect($$(`.ant-confirm-${type}`)).toHaveLength(0);
|
||||
});
|
||||
jest.useRealTimers();
|
||||
});
|
||||
});
|
||||
|
@ -1,9 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import Button from '../button';
|
||||
|
||||
function noop() {
|
||||
}
|
||||
|
||||
export interface TransferOperationProps {
|
||||
className?: string;
|
||||
leftArrowText?: string;
|
||||
@ -17,8 +14,8 @@ export interface TransferOperationProps {
|
||||
export default class Operation extends React.Component<TransferOperationProps, any> {
|
||||
render() {
|
||||
const {
|
||||
moveToLeft = noop,
|
||||
moveToRight = noop,
|
||||
moveToLeft,
|
||||
moveToRight,
|
||||
leftArrowText = '',
|
||||
rightArrowText = '',
|
||||
leftActive,
|
||||
|
Loading…
Reference in New Issue
Block a user