| 328 | /* tslint:enable:no-switch-case-fall-through */ |
| 329 | |
| 330 | export function triggerFakeKeyboardEvent(type: string, target: SimpleSelection<void>, keyCode: number, options?: {[key: string]: any}) { |
| 331 | const event = <KeyboardEvent> document.createEvent("Events"); |
| 332 | event.initEvent(type, true, true); |
| 333 | (event as any).keyCode = keyCode; |
| 334 | if (options != null) { |
| 335 | Object.keys(options).forEach((key) => (<any> event)[key] = options[key]); |
| 336 | } |
| 337 | (<HTMLElement> target.node()).dispatchEvent(event); |
| 338 | } |
| 339 | |
| 340 | export function assertAreaPathCloseTo(actualPath: string, expectedPath: string, precision: number, msg: string) { |
| 341 | const actualAreaPathNumbers = tokenizePathString(actualPath); |