From 125f6b65041ffc96acd8b76d9f3cf802d52e703d Mon Sep 17 00:00:00 2001 From: Francisco Hodge Date: Sun, 25 Nov 2018 18:11:09 -0500 Subject: [PATCH] Tests update --- src/lib/components/tests/Keyboard.test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lib/components/tests/Keyboard.test.js b/src/lib/components/tests/Keyboard.test.js index ac7b809a..dff7dfba 100644 --- a/src/lib/components/tests/Keyboard.test.js +++ b/src/lib/components/tests/Keyboard.test.js @@ -870,6 +870,24 @@ it('Keyboard handleButtonMouseDown will work', () => { }); +it('Keyboard handleButtonMouseDown will work with preventMouseDownDefault', () => { + testUtil.setDOM(); + + let keyboard = new Keyboard(); + + keyboard.options.preventMouseDownDefault = true; + + keyboard.handleButtonMouseDown("q", { + target: keyboard.getButtonElement("q") + }); + + var clickEvent = document.createEvent('MouseEvents'); + clickEvent.initEvent('mousedown', true, true); + keyboard.getButtonElement("q").dispatchEvent(clickEvent); + document.onmouseup(); + +}); + it('Keyboard onModulesLoaded will work', () => { testUtil.setDOM();