GitHub

MockMagentoCustomerAddress

class

import { MockMagentoCustomerAddress } from '@daffodil/customer/driver/magento/testing'

class MockMagentoCustomerAddress implements MagentoCustomerAddress {
  __typename: string = 'CustomerAddress'
  id: enforceUnique(faker.number.int) = enforceUnique(faker.number.int)
  region: { __typename: string; region_code: any; region_id: any; } = {
      __typename: 'CustomerAddressRegion',
      region_code: faker.location.state({ abbreviated: true }),
      region_id: enforceUnique(faker.number.int),
    }
  country_code: faker.location.countryCode() = faker.location.countryCode()
  street: any[] = [faker.location.streetAddress()]
  company: faker.company.name() = faker.company.name()
  telephone: faker.phone.number() = faker.phone.number()
  postcode: faker.location.zipCode() = faker.location.zipCode()
  city: faker.location.city() = faker.location.city()
  firstname: faker.person.firstName() = faker.person.firstName()
  lastname: faker.person.lastName() = faker.person.lastName()
  email: faker.internet.email() = faker.internet.email()
  default_billing: faker.datatype.boolean() = faker.datatype.boolean()
  default_shipping: faker.datatype.boolean() = faker.datatype.boolean()
}