chore: improve test utils

This commit is contained in:
陈嘉涵
2020-02-20 16:31:42 +08:00
parent 9b70d1a4dc
commit 871398b223
3 changed files with 11 additions and 21 deletions
+1 -7
View File
@@ -1,10 +1,4 @@
import { mount, trigger, triggerDrag } from '../../../test';
function mockScrollIntoView() {
const fn = jest.fn();
Element.prototype.scrollIntoView = fn;
return fn;
}
import { mount, trigger, triggerDrag, mockScrollIntoView } from '../../../test';
function mockOffsetHeight(offsetHeight) {
Object.defineProperty(HTMLElement.prototype, 'offsetHeight', {