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 bac721c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/functional/GlobeControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,28 @@ describe('GlobeControls with globe example', function _() {
assert.ok(Math.abs(result) < 100);
});

it('should zoom like expected with mouse wheel', async () => {
it('should zoom like expected with mouse wheel', async function () {

Check warning on line 180 in test/functional/GlobeControls.js

View workflow job for this annotation

GitHub Actions / Build bundle, check Linter and generate documentation

Unexpected unnamed async function
// 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 bac721c

Please sign in to comment.