| 1 |
import { test, expect } from "@odoo/hoot"; |
| 2 |
import { mountWithCleanup } from "@web/../tests/web_test_helpers"; |
| 3 |
import { setupPosEnv, getFilledOrder } from "../utils"; |
| 4 |
import { definePosModels } from "../data/generate_model_definitions"; |
| 5 |
import { queryOne } from "@odoo/hoot-dom"; |
| 6 |
import { ReceiptScreen } from "@point_of_sale/app/screens/receipt_screen/receipt_screen"; |
| 7 |
|
| 8 |
definePosModels(); |
| 9 |
|
| 10 |
test("Total on receipt always incl", async () => { |
| 11 |
const store = await setupPosEnv(); |
| 12 |
const order = await getFilledOrder(store); |
| 13 |
order.config.iface_tax_included = "total"; |
| 14 |
await mountWithCleanup(ReceiptScreen, { |
| 15 |
props: { orderUuid: order.uuid }, |
| 16 |
}); |
| 17 |
const total = queryOne(".pos-receipt-amount .pos-receipt-right-align"); |
| 18 |
expect(total.innerHTML).toBe("$ 17.85"); |
| 19 |
order.config.iface_tax_included = "subtotal"; |
| 20 |
const subtotal = queryOne(".pos-receipt-amount .pos-receipt-right-align"); |
| 21 |
expect(subtotal.innerHTML).toBe("$ 17.85"); |
| 22 |
}); |