mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-01-19 08:32:57 +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', () => {
|
||||
testUtil.setDOM();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user