Skip to content

Commit

Permalink
fix(cart draft presets): use company address as shipping address inst… (
Browse files Browse the repository at this point in the history
#496)

* fix(cart draft presets): use company address as shipping address instead of customer address

* chore(changeset): add changeset
  • Loading branch information
ByronDWall authored Feb 27, 2024
1 parent 0fab90a commit ee0ff71
Show file tree
Hide file tree
Showing 25 changed files with 341 additions and 984 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-dingos-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-test-data/cart': patch
---

use company address as shipping address insteead of customer address in b2b cart draft presets
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,7 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart1 preset`, () => {
expect(eagleHeavyLiftTechnologiesIncUsCart1Preset).toMatchInlineSnapshot(`
{
"anonymousId": undefined,
"billingAddress": {
"additionalAddressInfo": undefined,
"additionalStreetInfo": undefined,
"apartment": undefined,
"building": undefined,
"city": "Edinburgh",
"company": undefined,
"country": "GB",
"custom": undefined,
"department": undefined,
"email": undefined,
"externalId": undefined,
"fax": undefined,
"firstName": "Michael",
"id": undefined,
"key": undefined,
"lastName": "Williams",
"mobile": undefined,
"pOBox": undefined,
"phone": undefined,
"postalCode": "EH2 2LE",
"region": "Scotland",
"salutation": undefined,
"state": undefined,
"streetName": "George Street",
"streetNumber": "42",
"title": undefined,
},
"billingAddress": undefined,
"businessUnit": undefined,
"country": "US",
"currency": "USD",
Expand Down Expand Up @@ -104,29 +77,29 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart1 preset`, () => {
"shippingAddress": {
"additionalAddressInfo": undefined,
"additionalStreetInfo": undefined,
"apartment": undefined,
"building": undefined,
"city": "Edinburgh",
"company": undefined,
"country": "GB",
"apartment": "789",
"building": "A",
"city": "New York",
"company": "Eagle Heavy Lift Technologies Inc. NY",
"country": "US",
"custom": undefined,
"department": undefined,
"email": undefined,
"externalId": undefined,
"fax": undefined,
"firstName": "Michael",
"firstName": undefined,
"id": undefined,
"key": undefined,
"lastName": "Williams",
"key": "eagle-heavy-lift-technologies-inc-us-ny-1",
"lastName": undefined,
"mobile": undefined,
"pOBox": undefined,
"phone": undefined,
"postalCode": "EH2 2LE",
"region": "Scotland",
"postalCode": "10001",
"region": "New York",
"salutation": undefined,
"state": undefined,
"streetName": "George Street",
"streetNumber": "42",
"state": "New York",
"streetName": "Broadway",
"streetNumber": "123",
"title": undefined,
},
"shippingMethod": {
Expand All @@ -153,34 +126,7 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart1 preset`, () => {
.toMatchInlineSnapshot(`
{
"anonymousId": undefined,
"billingAddress": {
"additionalAddressInfo": undefined,
"additionalStreetInfo": undefined,
"apartment": undefined,
"building": undefined,
"city": "Edinburgh",
"company": undefined,
"country": "GB",
"custom": undefined,
"department": undefined,
"email": undefined,
"externalId": undefined,
"fax": undefined,
"firstName": "Michael",
"id": undefined,
"key": undefined,
"lastName": "Williams",
"mobile": undefined,
"pOBox": undefined,
"phone": undefined,
"postalCode": "EH2 2LE",
"region": "Scotland",
"salutation": undefined,
"state": undefined,
"streetName": "George Street",
"streetNumber": "42",
"title": undefined,
},
"billingAddress": undefined,
"businessUnit": undefined,
"country": "US",
"currency": "USD",
Expand Down Expand Up @@ -249,29 +195,29 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart1 preset`, () => {
"shippingAddress": {
"additionalAddressInfo": undefined,
"additionalStreetInfo": undefined,
"apartment": undefined,
"building": undefined,
"city": "Edinburgh",
"company": undefined,
"country": "GB",
"apartment": "789",
"building": "A",
"city": "New York",
"company": "Eagle Heavy Lift Technologies Inc. NY",
"country": "US",
"custom": undefined,
"department": undefined,
"email": undefined,
"externalId": undefined,
"fax": undefined,
"firstName": "Michael",
"firstName": undefined,
"id": undefined,
"key": undefined,
"lastName": "Williams",
"key": "eagle-heavy-lift-technologies-inc-us-ny-1",
"lastName": undefined,
"mobile": undefined,
"pOBox": undefined,
"phone": undefined,
"postalCode": "EH2 2LE",
"region": "Scotland",
"postalCode": "10001",
"region": "New York",
"salutation": undefined,
"state": undefined,
"streetName": "George Street",
"streetNumber": "42",
"state": "New York",
"streetName": "Broadway",
"streetNumber": "123",
"title": undefined,
},
"shippingMethod": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import type { TCartDraftBuilder } from '../../../types';
const customer = CustomerDraft.presets.sampleDataB2B
.michaelWilliams()
.build<TCustomerDraft>();
const address = AddressDraft.presets.sampleDataB2B.michaelWilliamsAddress();
const address =
AddressDraft.presets.sampleDataB2B.eagleHeavyLiftTechnologiesIncUsNy1Address();

const eee123Qr01 = ProductVariantDraft.presets.sampleDataB2B
.eee123Qr01()
Expand Down Expand Up @@ -54,7 +55,6 @@ const eagleHeavyLiftTechnologiesIncUsCart1 = (
.country('US')
.origin(origin.Customer)
.shippingAddress(address)
.billingAddress(address)
.lineItems([
LineItemDraft.presets.empty().sku(eee123Qr01.sku).quantity(1),
LineItemDraft.presets.empty().sku(eee123Qr02.sku).quantity(1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,7 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart2 preset`, () => {
expect(eagleHeavyLiftTechnologiesIncUsCart2Preset).toMatchInlineSnapshot(`
{
"anonymousId": undefined,
"billingAddress": {
"additionalAddressInfo": undefined,
"additionalStreetInfo": undefined,
"apartment": undefined,
"building": undefined,
"city": "Edinburgh",
"company": undefined,
"country": "GB",
"custom": undefined,
"department": undefined,
"email": undefined,
"externalId": undefined,
"fax": undefined,
"firstName": "Michael",
"id": undefined,
"key": undefined,
"lastName": "Williams",
"mobile": undefined,
"pOBox": undefined,
"phone": undefined,
"postalCode": "EH2 2LE",
"region": "Scotland",
"salutation": undefined,
"state": undefined,
"streetName": "George Street",
"streetNumber": "42",
"title": undefined,
},
"billingAddress": undefined,
"businessUnit": undefined,
"country": "US",
"currency": "USD",
Expand Down Expand Up @@ -104,29 +77,29 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart2 preset`, () => {
"shippingAddress": {
"additionalAddressInfo": undefined,
"additionalStreetInfo": undefined,
"apartment": undefined,
"building": undefined,
"city": "Edinburgh",
"company": undefined,
"country": "GB",
"apartment": "789",
"building": "A",
"city": "New York",
"company": "Eagle Heavy Lift Technologies Inc. NY",
"country": "US",
"custom": undefined,
"department": undefined,
"email": undefined,
"externalId": undefined,
"fax": undefined,
"firstName": "Michael",
"firstName": undefined,
"id": undefined,
"key": undefined,
"lastName": "Williams",
"key": "eagle-heavy-lift-technologies-inc-us-ny-1",
"lastName": undefined,
"mobile": undefined,
"pOBox": undefined,
"phone": undefined,
"postalCode": "EH2 2LE",
"region": "Scotland",
"postalCode": "10001",
"region": "New York",
"salutation": undefined,
"state": undefined,
"streetName": "George Street",
"streetNumber": "42",
"state": "New York",
"streetName": "Broadway",
"streetNumber": "123",
"title": undefined,
},
"shippingMethod": {
Expand All @@ -153,34 +126,7 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart2 preset`, () => {
.toMatchInlineSnapshot(`
{
"anonymousId": undefined,
"billingAddress": {
"additionalAddressInfo": undefined,
"additionalStreetInfo": undefined,
"apartment": undefined,
"building": undefined,
"city": "Edinburgh",
"company": undefined,
"country": "GB",
"custom": undefined,
"department": undefined,
"email": undefined,
"externalId": undefined,
"fax": undefined,
"firstName": "Michael",
"id": undefined,
"key": undefined,
"lastName": "Williams",
"mobile": undefined,
"pOBox": undefined,
"phone": undefined,
"postalCode": "EH2 2LE",
"region": "Scotland",
"salutation": undefined,
"state": undefined,
"streetName": "George Street",
"streetNumber": "42",
"title": undefined,
},
"billingAddress": undefined,
"businessUnit": undefined,
"country": "US",
"currency": "USD",
Expand Down Expand Up @@ -249,29 +195,29 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart2 preset`, () => {
"shippingAddress": {
"additionalAddressInfo": undefined,
"additionalStreetInfo": undefined,
"apartment": undefined,
"building": undefined,
"city": "Edinburgh",
"company": undefined,
"country": "GB",
"apartment": "789",
"building": "A",
"city": "New York",
"company": "Eagle Heavy Lift Technologies Inc. NY",
"country": "US",
"custom": undefined,
"department": undefined,
"email": undefined,
"externalId": undefined,
"fax": undefined,
"firstName": "Michael",
"firstName": undefined,
"id": undefined,
"key": undefined,
"lastName": "Williams",
"key": "eagle-heavy-lift-technologies-inc-us-ny-1",
"lastName": undefined,
"mobile": undefined,
"pOBox": undefined,
"phone": undefined,
"postalCode": "EH2 2LE",
"region": "Scotland",
"postalCode": "10001",
"region": "New York",
"salutation": undefined,
"state": undefined,
"streetName": "George Street",
"streetNumber": "42",
"state": "New York",
"streetName": "Broadway",
"streetNumber": "123",
"title": undefined,
},
"shippingMethod": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import type { TCartDraftBuilder } from '../../../types';
const customer = CustomerDraft.presets.sampleDataB2B
.michaelWilliams()
.build<TCustomerDraft>();
const address = AddressDraft.presets.sampleDataB2B.michaelWilliamsAddress();
const address =
AddressDraft.presets.sampleDataB2B.eagleHeavyLiftTechnologiesIncUsNy1Address();

const yy123Qr01 = ProductVariantDraft.presets.sampleDataB2B
.yy123Qr01()
Expand Down Expand Up @@ -54,7 +55,6 @@ const eagleHeavyLiftTechnologiesIncUsCart2 = (
.country('US')
.origin(origin.Customer)
.shippingAddress(address)
.billingAddress(address)
.lineItems([
LineItemDraft.presets.empty().sku(yy123Qr01.sku).quantity(1),
LineItemDraft.presets.empty().sku(yy123Qr02.sku).quantity(1),
Expand Down
Loading

0 comments on commit ee0ff71

Please sign in to comment.