mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-03-16 16:43:46 +08:00
Tests update
This commit is contained in:
parent
97b475a2b7
commit
125f6b6504
@ -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', () => {
|
it('Keyboard onModulesLoaded will work', () => {
|
||||||
testUtil.setDOM();
|
testUtil.setDOM();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user