mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix: client: polyfill (#442)
This commit is contained in:
parent
b34ee44bb1
commit
884c83eb60
2 changed files with 2 additions and 5 deletions
|
|
@ -3,7 +3,7 @@
|
|||
/* global DOM */
|
||||
require('domtokenlist-shim');
|
||||
|
||||
const scrollIntoViewIfNeeded = require('scroll-into-view-if-needed').default;
|
||||
const scrollIntoViewIfNeeded = require('scroll-into-view-if-needed');
|
||||
|
||||
DOM.scrollIntoViewIfNeeded = (el) => scrollIntoViewIfNeeded(el, {
|
||||
block: 'nearest',
|
||||
|
|
|
|||
|
|
@ -13,10 +13,7 @@ test('cloudcmd: client: polyfill: scrollIntoViewIfNeaded', (t) => {
|
|||
|
||||
global.DOM = {};
|
||||
|
||||
mockRequire('scroll-into-view-if-needed', {
|
||||
default: scroll,
|
||||
});
|
||||
|
||||
mockRequire('scroll-into-view-if-needed', scroll);
|
||||
mockRequire.reRequire('./polyfill');
|
||||
|
||||
global.DOM.scrollIntoViewIfNeeded(el);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue