|
|
@ -67,6 +67,19 @@ describe('Modal.confirm triggers callbacks correctly', () => { |
|
|
|
expect(errorSpy).not.toHaveBeenCalled(); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should emit error when onOk return Promise.reject', () => { |
|
|
|
const error = new Error('something wrong'); |
|
|
|
open({ |
|
|
|
onOk: () => Promise.reject(error), |
|
|
|
}); |
|
|
|
// Fifth Modal
|
|
|
|
$$('.ant-btn-primary')[0].click(); |
|
|
|
// wait promise
|
|
|
|
return Promise.resolve().then(() => { |
|
|
|
expect(errorSpy).toHaveBeenCalledWith(error); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
if (process.env.REACT !== '15') { |
|
|
|
it('shows animation when close', () => { |
|
|
|
jest.useFakeTimers(); |
|
|
|