GitHub

MockMagentoCart

import { MockMagentoCart } from '@daffodil/cart/driver/magento/testing'
class MockMagentoCart implements MagentoCart {
  __typename: 'Cart'
  id: faker.datatype.uuid()
  prices: {
      __typename: 'CartPrices',
      subtotal_excluding_tax: this.money(),
      grand_total: this.money(),
      subtotal_including_tax: this.money(),
      subtotal_with_discount_excluding_tax: this.money(),
      applied_taxes: [{
              __typename: 'AppliedTax',
              amount: this.money(),
              label: 'tax'
          }],
      discounts: [{
              __typename: 'Discount',
              amount: this.money(),
              label: 'discount'
          }]
  }
  applied_coupons: []
  items: []
  billing_address: null
  shipping_addresses: []
  available_payment_methods: []
  selected_payment_method: null
  email: faker.internet.email()
}

Properties

Name Type Description
__typename 'Cart'
id faker.datatype.uuid()
prices { __typename: 'CartPrices', subtotal_excluding_tax: this.money(), grand_total: this.money(), subtotal_including_tax: this.money(), subtotal_with_discount_excluding_tax: this.money(), applied_taxes: [{ __typename: 'AppliedTax', amount: this.money(), label: 'tax' }], discounts: [{ __typename: 'Discount', amount: this.money(), label: 'discount' }] }
applied_coupons []
items []
billing_address null
shipping_addresses []
available_payment_methods []
selected_payment_method null
email faker.internet.email()