UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

33 lines (26 loc) 940 B
describe('Should support simulating mouse wheel events', function (t) { // not supported for native Puppeteer if (t.simulator.type == 'native' && t.harness.isPuppeteer) return var field = new Ext.form.NumberField({ id : 'field', renderTo : document.body }); var inputEl = field.inputEl.dom; var onWheel = function (event) { return event.browserEvent.deltaX === 10 && event.browserEvent.deltaY === 10 && event.browserEvent.deltaZ === 0; }; // native simulator has very poor support for mouse wheel if (t.simulator.type == 'synthetic') t.isFiredWithSignature(inputEl, 'wheel', onWheel) t.firesOk({ observable : inputEl, events : { 'wheel' : '>=1' } }) t.chain( { click : inputEl }, { wheel : inputEl, options : { deltaX : 10, deltaY : 10, deltaZ : 0 }} ); })