@testing-library/user-event
Version:
Fire events the same way the user does
20 lines (18 loc) • 417 B
JavaScript
class Device {
get countPressed() {
return this.pressedKeys.size;
}
isPressed(keyDef) {
return this.pressedKeys.has(keyDef.name);
}
addPressed(keyDef) {
return this.pressedKeys.add(keyDef.name);
}
removePressed(keyDef) {
return this.pressedKeys.delete(keyDef.name);
}
constructor(){
this.pressedKeys = new Set();
}
}
export { Device };