test: adds integration test for shipping-option-requirements

This commit is contained in:
Sebastian Rindom
2021-06-08 17:21:42 +02:00
parent eb0a4afd79
commit 10113d0657
3 changed files with 98 additions and 0 deletions
@@ -3,6 +3,7 @@ const {
Customer,
MoneyAmount,
ShippingOption,
ShippingOptionRequirement,
Product,
ProductVariant,
Region,
@@ -166,6 +167,24 @@ module.exports = async (connection, data = {}) => {
data: {},
});
await manager.insert(ShippingOption, {
id: "test-option-req",
name: "test-option-req",
provider_id: "test-ful",
region_id: "test-region",
profile_id: defaultProfile.id,
price_type: "flat_rate",
amount: 1000,
data: {},
});
await manager.insert(ShippingOptionRequirement, {
id: "option-req",
shipping_option_id: "test-option-req",
type: "min_subtotal",
amount: 10,
});
const c = manager.create(Cart, {
id: "test-cart",
customer_id: "oli-test",