mirror of
https://github.com/bringout/oca-ocb-technical.git
synced 2026-04-19 04:12:03 +02:00
Initial commit: Technical packages
This commit is contained in:
commit
3473fa71a0
873 changed files with 297766 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
/* @odoo-module */
|
||||
|
||||
import { triggerEvent } from "@web/../tests/helpers/utils";
|
||||
|
||||
export function simulateBarCode(chars, target = document.body, selector = undefined) {
|
||||
for (let char of chars) {
|
||||
let keycode;
|
||||
if (char === "Enter") {
|
||||
keycode = $.ui.keyCode.ENTER;
|
||||
} else if (char === "Tab") {
|
||||
keycode = $.ui.keyCode.TAB;
|
||||
} else {
|
||||
keycode = char.charCodeAt(0);
|
||||
}
|
||||
triggerEvent(target, selector, "keydown", {
|
||||
key: char,
|
||||
keyCode: keycode,
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue