mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-23 05:14:29 +02:00
Removing unneeded trickery
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import scrollTo from '../../src/js/utils/scroll-to';
|
||||||
|
|
||||||
jest.useFakeTimers();
|
jest.useFakeTimers();
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
@@ -7,11 +9,9 @@ beforeAll(() => {
|
|||||||
|
|
||||||
test('ScrollTo utility', () => {
|
test('ScrollTo utility', () => {
|
||||||
const ws = document.getElementById('webslides');
|
const ws = document.getElementById('webslides');
|
||||||
// Needs to be required and not imported because const defined in top level
|
|
||||||
const scrollTo = require('../../src/js/utils/scroll-to');
|
|
||||||
const cb = jest.fn();
|
const cb = jest.fn();
|
||||||
|
|
||||||
scrollTo.default(100, 500, cb);
|
scrollTo(100, 500, cb);
|
||||||
|
|
||||||
expect(cb).not.toBeCalled();
|
expect(cb).not.toBeCalled();
|
||||||
expect(ws.scrollTop).toBe(0);
|
expect(ws.scrollTop).toBe(0);
|
||||||
|
Reference in New Issue
Block a user