Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit 5ec51d8

Browse files
committed
Removed pageX/Y setters
1 parent 130a318 commit 5ec51d8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/packageLogs_spec.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,19 @@ describe('packageLogs', () => {
261261
new JSDOM(``);
262262
const document = window.document;
263263
const ele = document.createElement('div');
264+
// Create a click in the top left corner of the viewport
264265
const evt = new window.MouseEvent('click', {
265266
'view': window,
266267
'bubbles': true,
267-
'cancelable': true
268+
'cancelable': true,
269+
'clientX': 0,
270+
'clientY': 0,
268271
});
269272
document.body.appendChild(ele);
270273
ele.addEventListener('click', (e) => {
271-
e.pageX = 0;
272-
e.pageY = 0;
273-
expect(getLocation(e)).to.deep.equal({x: 0, y: 0});
274+
// Expect the click location to be the top left corner of the viewport
275+
let expectedLocation = {'x': window.scrollX, 'y': window.scrollY};
276+
expect(getLocation(e)).to.deep.equal(expectedLocation);
274277
});
275278
ele.dispatchEvent(evt);
276279
});

0 commit comments

Comments
 (0)