Additional tests

This commit is contained in:
Angelos Chalaris
2018-11-10 11:12:59 +02:00
parent e24ff01139
commit 34bd448512
5 changed files with 39 additions and 0 deletions

View File

@ -4,3 +4,14 @@ const {getScrollPosition} = require('./_30s.js');
test('getScrollPosition is a Function', () => {
expect(getScrollPosition).toBeInstanceOf(Function);
});
test('getScrollPosition returns an object with x and y values', () => {
let scrollPos = getScrollPosition();
expect(typeof scrollPos.x).toBe('number');
expect(typeof scrollPos.y).toBe('number');
});
test('getScrollPosition returns an object with x and y values', () => {
let el = document.createElement('div');
let scrollPos = getScrollPosition(el);
expect(typeof scrollPos.x).toBe('number');
expect(typeof scrollPos.y).toBe('number');
});