mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-04-11 00:02:15 +08:00
Adding onModulesLoaded
This commit is contained in:
@@ -838,4 +838,27 @@ it('Keyboard handleButtonMouseDown will work', () => {
|
||||
keyboard.getButtonElement("q").onmousedown();
|
||||
document.onmouseup();
|
||||
|
||||
});
|
||||
|
||||
it('Keyboard onModulesLoaded will work', () => {
|
||||
testUtil.setDOM();
|
||||
|
||||
class myClass {
|
||||
init = (module) => {
|
||||
module.foo = "bar";
|
||||
};
|
||||
}
|
||||
|
||||
let foo;
|
||||
|
||||
let keyboard = new Keyboard({
|
||||
modules: [
|
||||
myClass
|
||||
],
|
||||
onModulesLoaded: () => {
|
||||
foo = "bar";
|
||||
}
|
||||
});
|
||||
|
||||
expect(foo).toBe("bar");
|
||||
});
|
||||
Reference in New Issue
Block a user