CON-1809 | Fix overlapping of anchored element

this test currently is dependent on window object which makes it rather integration test than unit test. Could you mock the document object instead?