mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
✅ util test
This commit is contained in:
parent
e7027311bb
commit
9300cd88ba
@ -2,6 +2,7 @@ import raf from 'raf';
|
||||
import delayRaf from '../raf';
|
||||
import throttleByAnimationFrame from '../throttleByAnimationFrame';
|
||||
import getDataOrAriaProps from '../getDataOrAriaProps';
|
||||
import triggerEvent from '../triggerEvent';
|
||||
|
||||
describe('Test utils function', () => {
|
||||
beforeAll(() => {
|
||||
@ -114,4 +115,13 @@ describe('Test utils function', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('triggerEvent', () => {
|
||||
const button = document.createElement('button');
|
||||
button.addEventListener('click', () => {
|
||||
button.style.width = '100px';
|
||||
}, true);
|
||||
triggerEvent(button, 'click');
|
||||
expect(button.style.width).toBe('100px');
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user