| 1 |
import * as Order from "@point_of_sale/../tests/generic_helpers/order_widget_util"; |
| 2 |
|
| 3 |
export function clickOrderline(productName) { |
| 4 |
return Order.hasLine({ productName, run: "click" }); |
| 5 |
} |
| 6 |
export function clickBack() { |
| 7 |
return [ |
| 8 |
{ |
| 9 |
content: "click back button", |
| 10 |
trigger: `.splitbill-screen .button.back`, |
| 11 |
run: "click", |
| 12 |
}, |
| 13 |
]; |
| 14 |
} |
| 15 |
export function clickButton(name) { |
| 16 |
return [ |
| 17 |
{ |
| 18 |
content: `click '${name}' button`, |
| 19 |
trigger: `.splitbill-screen .pay-button button:contains("${name}")`, |
| 20 |
run: "click", |
| 21 |
}, |
| 22 |
]; |
| 23 |
} |
| 24 |
|
| 25 |
export function orderlineHas(name, totalQuantity, splitQuantity) { |
| 26 |
return Order.hasLine({ |
| 27 |
productName: name, |
| 28 |
quantity: splitQuantity != 0 ? `${splitQuantity} / ${totalQuantity}` : totalQuantity, |
| 29 |
}); |
| 30 |
} |
| 31 |
export function subtotalIs(amount) { |
| 32 |
return [ |
| 33 |
{ |
| 34 |
content: `total amount of split is '${amount}'`, |
| 35 |
trigger: `.splitbill-screen .order-info .subtotal:contains("${amount}")`, |
| 36 |
run: "click", |
| 37 |
}, |
| 38 |
]; |
| 39 |
} |