19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:34 +01:00
parent 5faf7397c5
commit 2696f14ed7
721 changed files with 220375 additions and 91221 deletions

View file

@ -0,0 +1,31 @@
/** @odoo-module **/
import { expect, test } from "@odoo/hoot";
import { waitFor } from "@odoo/hoot-dom";
import { Component, xml } from "@odoo/owl";
import { BarcodeScanner } from "@barcodes/components/barcode_scanner";
import { contains, mountWithCleanup } from "@web/../tests/web_test_helpers";
test.tags("desktop");
test("Display notification for media device permission on barcode scanning", async () => {
navigator.mediaDevices.getUserMedia = function () {
return Promise.reject(new DOMException("", "NotAllowedError"));
};
class BarcodeScan extends Component {
static template = xml`
<div>
<BarcodeScanner onBarcodeScanned="(ev) => this.onBarcodeScanned(ev)"/>
</div>
`;
static components = { BarcodeScanner };
static props = ["*"];
}
await mountWithCleanup(BarcodeScan);
await contains("a.o_mobile_barcode").click();
await waitFor(".modal-body:contains(camera)");
expect(".modal-body").toHaveText(
"Unable to access camera\nCould not start scanning. Odoo needs your authorization first."
);
});