Skip to content

Commit

Permalink
feat: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Desplandis committed Dec 19, 2024
1 parent dc48291 commit b622fc7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/functional/GlobeControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,25 @@ describe('GlobeControls with globe example', function _() {
it('should zoom like expected with mouse wheel', async () => {
// FIX Me: use puppetter mouse#wheel instead of new WheelEvent
await page.evaluate(() => { view.controls.enableDamping = false; });
console.log('PASSING AWAIT 1');
await page.mouse.move(middleWidth, middleHeight, { steps: 20 });
console.log('PASSING AWAIT 2');
const finalRange = await page.evaluate(() => new Promise((resolve) => {
view.mainLoop.addEventListener('command-queue-empty', () => {
console.log('command-queue-empty');
if (view.mainLoop.renderingState === 0) {
resolve(view.controls.getRange());
}
});
console.log(view.mainLoop);
const wheelEvent = new WheelEvent('wheel', {
deltaY: -50000,
});
view.domElement.dispatchEvent(wheelEvent, document);
window.dispatchEvent(wheelEvent, document);
}));
console.log('PASSING AWAIT 3');
console.log(finalRange);
// On the travis server, the range is negative.
assert.ok(Math.abs(initialPosition.range - finalRange) > 2000000);
});
Expand Down

0 comments on commit b622fc7

Please sign in to comment.