cloudcmd/client/modules/polyfill.spec.js
2026-01-13 13:47:14 +02:00

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();
});