mirror of
https://github.com/bringout/oca-ocb-technical.git
synced 2026-04-18 09:32:03 +02:00
19.0 vanilla
This commit is contained in:
parent
5faf7397c5
commit
2696f14ed7
721 changed files with 220375 additions and 91221 deletions
|
|
@ -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."
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue