UNPKG

@wdio/image-comparison-core

Version:

Image comparison core module for @wdio/visual-service - WebdriverIO visual testing framework

12 lines (11 loc) 615 B
// @vitest-environment jsdom import { describe, it } from 'vitest'; import getElementPositionTopDom from './getElementPositionTopDom.js'; describe('getElementPositionTopDom', () => { it('should get the element position to the top of the Dom', () => { document.body.innerHTML = '<div>' + ' <span id="username">Hello</span>' + '</div>'; getElementPositionTopDom(document.querySelector('#username')); // I can't mock the offsetHeight, offsetWidth, offsetLeft, offsetTop with Jest, so there is no verification here, sorry :( // If you know a way, please add it here ;-) }); });