19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:29:53 +01:00
parent 6e54c1af6c
commit 3ca647e428
1087 changed files with 132065 additions and 108499 deletions

View file

@ -0,0 +1,26 @@
import { test, expect } from "@odoo/hoot";
import { setupPosEnv } from "@point_of_sale/../tests/unit/utils";
import { CashMovePopup } from "@point_of_sale/app/components/popups/cash_move_popup/cash_move_popup";
import { mountWithCleanup } from "@web/../tests/web_test_helpers";
import { definePosModels } from "@point_of_sale/../tests/unit/data/generate_model_definitions";
definePosModels();
test("_prepareTryCashInOutPayload", async () => {
await setupPosEnv();
const comp = await mountWithCleanup(CashMovePopup, {
props: { close: () => {} },
});
const result = comp._prepareTryCashInOutPayload();
const employee_id = result[result.length - 1].employee_id;
expect(employee_id).toBe(2);
});
test("partnerId", async () => {
const store = await setupPosEnv();
const comp = await mountWithCleanup(CashMovePopup, {
props: { close: () => {} },
});
const emp = store.models["hr.employee"].get(2);
store.setCashier(emp);
expect(comp.partnerId).toBe(emp.work_contact_id.id);
});

View file

@ -0,0 +1,27 @@
import { test, expect } from "@odoo/hoot";
import { setupPosEnv } from "@point_of_sale/../tests/unit/utils";
import { ProductInfoPopup } from "@point_of_sale/app/components/popups/product_info_popup/product_info_popup";
import { mountWithCleanup } from "@web/../tests/web_test_helpers";
import { definePosModels } from "@point_of_sale/../tests/unit/data/generate_model_definitions";
definePosModels();
test("allowProductEdition", async () => {
const store = await setupPosEnv();
store.addNewOrder();
const admin = store.models["hr.employee"].get(2);
store.setCashier(admin);
const product = store.models["product.template"].get(5);
const info = await store.getProductInfo(product, 1);
const comp = await mountWithCleanup(ProductInfoPopup, {
props: {
productTemplate: product,
info,
close: () => {},
},
});
expect(comp.allowProductEdition).toBe(true);
const emp = store.models["hr.employee"].get(3);
store.setCashier(emp);
expect(comp.allowProductEdition).toBe(false);
});