mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
22 lines
469 B
JavaScript
22 lines
469 B
JavaScript
'use strict';
|
|
|
|
const {test, stub} = require('supertape');
|
|
const {scrollIntoViewIfNeeded} = require('./polyfill');
|
|
|
|
test('cloudcmd: client: polyfill: scrollIntoViewIfNeaded', (t) => {
|
|
const scroll = stub();
|
|
const el = {};
|
|
|
|
scrollIntoViewIfNeeded(el, {
|
|
scroll,
|
|
});
|
|
|
|
const args = [
|
|
el, {
|
|
block: 'nearest',
|
|
},
|
|
];
|
|
|
|
t.calledWith(scroll, args, 'should call scrollIntoViewIfNeaded');
|
|
t.end();
|
|
});
|