Skip to content

Commit

Permalink
geosolutions-it#9688: Make DOMUtils tests less dependent on platform-…
Browse files Browse the repository at this point in the history
…varying browser default stylesheet (geosolutions-it#10046)

Co-authored-by: Florian Kellner <[email protected]>
  • Loading branch information
fkellner and Florian Kellner authored Mar 29, 2024
1 parent 4e60e80 commit 94fc7f6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web/client/utils/__tests__/DOMUtil-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@ 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 = `
<div id="container">
<div id="content">
test
</div>
</div>`;
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 = `
<div id="container">
<div id="content">
<div id="content" style="height: 18px">
test
</div>
</div>`;
Expand Down

0 comments on commit 94fc7f6

Please sign in to comment.