From d30494e8a362f3e19e2887a6a8fc0bd55818778f Mon Sep 17 00:00:00 2001 From: Bouillaguet Quentin Date: Thu, 19 Dec 2024 10:36:40 +0100 Subject: [PATCH] feat: test --- test/functional/.eslintrc.cjs | 64 -------------------------------- test/functional/GlobeControls.js | 8 +++- 2 files changed, 7 insertions(+), 65 deletions(-) delete mode 100644 test/functional/.eslintrc.cjs diff --git a/test/functional/.eslintrc.cjs b/test/functional/.eslintrc.cjs deleted file mode 100644 index 6807fb6b0c..0000000000 --- a/test/functional/.eslintrc.cjs +++ /dev/null @@ -1,64 +0,0 @@ -module.exports = { - extends: [ - 'eslint-config-airbnb-base', - 'eslint-config-airbnb-base/rules/strict', - ], - parserOptions: { - ecmaVersion: 2017, - sourceType: 'module', - ecmaFeatures: { - impliedStrict: true, - }, - }, - env: { - browser: true, - es6: false, - amd: true, - commonjs: true, - mocha: true, - }, - rules: { - 'no-plusplus': 'off', - 'no-undef': 'off', - // this option sets a specific tab width for your code - // http://eslint.org/docs/rules/indent - indent: ['error', 4, { - SwitchCase: 1, - VariableDeclarator: 1, - outerIIFEBody: 1, - // MemberExpression: null, - // CallExpression: { - // parameters: null, - // }, - FunctionDeclaration: { - parameters: 1, - body: 1, - }, - FunctionExpression: { - parameters: 1, - body: 1, - }, - }], - 'one-var': ['error', 'never'], - 'valid-jsdoc': ['error', { - requireReturn: false, - requireParamDescription: false, - requireReturnDescription: false, - }], - - // deactivated rules for `examples/` - 'no-console': 'off', - - // TODO reactivate all the following rules - 'no-underscore-dangle': 'off', - - // turned off to use the this object in describe - 'prefer-arrow-callback': 'off', - - 'prefer-destructuring': 'off', - 'max-len': 'off', - 'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }], - 'prefer-object-spread': 'off', - 'function-paren-newline': 'off', - }, -}; diff --git a/test/functional/GlobeControls.js b/test/functional/GlobeControls.js index 6dbef35b97..f0b80a60b3 100644 --- a/test/functional/GlobeControls.js +++ b/test/functional/GlobeControls.js @@ -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 () { // 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); });