diff --git a/web/client/utils/__tests__/DOMUtil-test.js b/web/client/utils/__tests__/DOMUtil-test.js index a7930904d6..06f8c017f7 100644 --- a/web/client/utils/__tests__/DOMUtil-test.js +++ b/web/client/utils/__tests__/DOMUtil-test.js @@ -24,6 +24,8 @@ describe('Test the DOMUtils', () => { expect(spy.calls.length).toEqual(1); }); it('test getOffsetTop', function() { + const desiredOffset = 8; + document.body.style.cssText = `margin: ${desiredOffset} px;`; document.body.innerHTML = `
@@ -31,12 +33,13 @@ describe('Test the DOMUtils', () => {
`; const offset = getOffsetTop(document.querySelector("#content")); - expect(offset).toEqual(8); + expect(offset).toEqual(desiredOffset); }); it('test getOffsetBottom', function() { + document.body.style.cssText = `margin: 8 px;`; document.body.innerHTML = `
-
+
test
`;