mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-26 08:22:04 +02:00
19.0 vanilla
This commit is contained in:
parent
6e54c1af6c
commit
3ca647e428
1087 changed files with 132065 additions and 108499 deletions
|
|
@ -0,0 +1,25 @@
|
|||
import { test, expect } from "@odoo/hoot";
|
||||
import { setupPosEnv } from "@point_of_sale/../tests/unit/utils";
|
||||
import { CashierName } from "@point_of_sale/app/components/navbar/cashier_name/cashier_name";
|
||||
import { mountWithCleanup } from "@web/../tests/web_test_helpers";
|
||||
import { definePosModels } from "@point_of_sale/../tests/unit/data/generate_model_definitions";
|
||||
|
||||
definePosModels();
|
||||
|
||||
test("avatarAndCssClass", async () => {
|
||||
await setupPosEnv();
|
||||
const comp = await mountWithCleanup(CashierName, {});
|
||||
expect(comp.avatar).toBe("/web/image/hr.employee.public/2/avatar_128");
|
||||
expect(comp.cssClass).toMatchObject({ oe_status: true });
|
||||
});
|
||||
test("selectCashier", async () => {
|
||||
const store = await setupPosEnv();
|
||||
const comp = await mountWithCleanup(CashierName, {});
|
||||
const result = await comp.selectCashier();
|
||||
expect(result.name).toBe("Employee1");
|
||||
expect(result.id).toBe(3);
|
||||
store.setCashier(result);
|
||||
const value = store.getCashier();
|
||||
expect(value.name).toBe("Employee1");
|
||||
expect(value.id).toBe(3);
|
||||
});
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import { test, expect } from "@odoo/hoot";
|
||||
import { setupPosEnv } from "@point_of_sale/../tests/unit/utils";
|
||||
import { Navbar } from "@point_of_sale/app/components/navbar/navbar";
|
||||
import { mountWithCleanup } from "@web/../tests/web_test_helpers";
|
||||
import { definePosModels } from "@point_of_sale/../tests/unit/data/generate_model_definitions";
|
||||
|
||||
definePosModels();
|
||||
|
||||
test("showCreateProductButtonWithAdmin", async () => {
|
||||
const store = await setupPosEnv();
|
||||
const admin = store.models["hr.employee"].get(2);
|
||||
store.setCashier(admin);
|
||||
const comp = await mountWithCleanup(Navbar, {});
|
||||
expect(comp.showCreateProductButton).toBe(true);
|
||||
});
|
||||
|
||||
test("showCreateProductButtonWithNonAdmin", async () => {
|
||||
const store = await setupPosEnv();
|
||||
const emp = store.models["hr.employee"].get(3);
|
||||
store.setCashier(emp);
|
||||
const comp = await mountWithCleanup(Navbar, {});
|
||||
expect(comp.showCreateProductButton).toBe(false);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue