mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-04-11 00:02:15 +08:00
Merge branch 'master' of https://github.com/hodgef/simple-keyboard
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import Keyboard from '../../lib';
|
||||
import SimpleKeyboardKeyNavigation from 'simple-keyboard-key-navigation';
|
||||
|
||||
test('Module simple-keyboard-key-navigation runs without crashing', () => {
|
||||
const div = document.createElement('div');
|
||||
|
||||
div.className = "simple-keyboard";
|
||||
document.body.appendChild(div);
|
||||
|
||||
const keyboard = new Keyboard({
|
||||
debug: true,
|
||||
onChange: input => input,
|
||||
onKeyPress: button => button,
|
||||
enableKeyNavigation: true,
|
||||
modules: [
|
||||
SimpleKeyboardKeyNavigation
|
||||
]
|
||||
});
|
||||
|
||||
keyboard.modules.keyNavigation.right();
|
||||
keyboard.modules.keyNavigation.down();
|
||||
keyboard.modules.keyNavigation.press();
|
||||
|
||||
expect(keyboard.getInput()).toBe("q");
|
||||
});
|
||||
Reference in New Issue
Block a user