mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-04-30 00:00:04 +08:00
Merge branch 'master' of https://github.com/hodgef/simple-keyboard
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import Keyboard from '../../lib';
|
||||
import SimpleKeyboardAutocorrect from 'simple-keyboard-autocorrect';
|
||||
|
||||
test('Module simple-keyboard-autocorrect 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,
|
||||
newLineOnEnter: true,
|
||||
useMouseEvents: true,
|
||||
autocorrectDict: ["dog", "house"],
|
||||
modules: [
|
||||
SimpleKeyboardAutocorrect
|
||||
]
|
||||
});
|
||||
|
||||
keyboard.getButtonElement("d").onclick();
|
||||
keyboard.getButtonElement("o").onclick();
|
||||
keyboard.getButtonElement("{space}").onclick();
|
||||
keyboard.getButtonElement("{bksp}").onclick();
|
||||
|
||||
expect(keyboard.getInput()).toBe("dog");
|
||||
});
|
||||
Reference in New Issue
Block a user