Skip to content

Commit

Permalink
fix(cart draft presets): add correct business unit to b2b cart presets (
Browse files Browse the repository at this point in the history
#503)

* fix(cart draft presets): add correct business unit to b2b cart presets

* fix(package json): install business unit from remote registry do not link it
  • Loading branch information
ByronDWall authored Feb 28, 2024
1 parent 7a5d138 commit 09edcba
Show file tree
Hide file tree
Showing 27 changed files with 251 additions and 37 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-buckets-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-test-data/cart': patch
---

add correct business unit to b2b cart presets
3 changes: 2 additions & 1 deletion models/cart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@
"dependencies": {
"@babel/runtime": "^7.17.9",
"@babel/runtime-corejs3": "^7.17.9",
"@commercetools-test-data/business-unit": "7.2.3",
"@commercetools-test-data/channel": "7.2.3",
"@commercetools-test-data/commons": "7.2.3",
"@commercetools-test-data/core": "7.2.3",
"@commercetools-test-data/customer": "7.2.3",
"@commercetools-test-data/discount-code": "7.2.3",
"@commercetools-test-data/product": "7.2.3",
"@commercetools-test-data/shipping-method": "7.2.3",
"@commercetools-test-data/store": "7.2.3",
"@commercetools-test-data/tax-category": "7.2.3",
"@commercetools-test-data/utils": "7.2.3",
"@commercetools-test-data/store": "7.2.3",
"@commercetools/platform-sdk": "^7.0.0",
"@faker-js/faker": "^8.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart1 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "eagle-heavy-lift-technologies-inc-us",
"typeId": "business-unit",
},
"country": "US",
"currency": "USD",
"custom": undefined,
Expand Down Expand Up @@ -127,7 +130,10 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart1 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "eagle-heavy-lift-technologies-inc-us",
"typeId": "business-unit",
},
"country": "US",
"currency": "USD",
"custom": undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
CompanyDraft,
type TCompanyDraft,
} from '@commercetools-test-data/business-unit';
import {
AddressDraft,
KeyReferenceDraft,
Expand All @@ -10,6 +14,7 @@ import {
ProductVariantDraft,
type TProductVariantDraft,
} from '@commercetools-test-data/product';

import {
ShippingMethodDraft,
type TShippingMethodDraft,
Expand Down Expand Up @@ -43,6 +48,10 @@ const store = StoreDraft.presets.sampleDataB2B
.usLargeCustomers()
.build<TStoreDraft>();

const businessUnit = CompanyDraft.presets.sampleDataB2B
.eagleHeavyLiftTechnologiesIncUs()
.build<TCompanyDraft>();

const eagleHeavyLiftTechnologiesIncUsCart1 = (
customerId?: string
): TCartDraftBuilder =>
Expand All @@ -63,6 +72,9 @@ const eagleHeavyLiftTechnologiesIncUsCart1 = (
.shippingMethod(
KeyReferenceDraft.presets.shippingMethod().key(shippingMethod.key!)
)
.store(KeyReferenceDraft.presets.store().key(store.key!));
.store(KeyReferenceDraft.presets.store().key(store.key!))
.businessUnit(
KeyReferenceDraft.presets.businessUnit().key(businessUnit.key!)
);

export default eagleHeavyLiftTechnologiesIncUsCart1;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart2 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "eagle-heavy-lift-technologies-inc-us",
"typeId": "business-unit",
},
"country": "US",
"currency": "USD",
"custom": undefined,
Expand Down Expand Up @@ -127,7 +130,10 @@ describe(`with eagleHeavyLiftTechnologiesIncUsCart2 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "eagle-heavy-lift-technologies-inc-us",
"typeId": "business-unit",
},
"country": "US",
"currency": "USD",
"custom": undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
CompanyDraft,
type TCompanyDraft,
} from '@commercetools-test-data/business-unit';
import {
AddressDraft,
KeyReferenceDraft,
Expand Down Expand Up @@ -43,6 +47,10 @@ const store = StoreDraft.presets.sampleDataB2B
.usLargeCustomers()
.build<TStoreDraft>();

const businessUnit = CompanyDraft.presets.sampleDataB2B
.eagleHeavyLiftTechnologiesIncUs()
.build<TCompanyDraft>();

const eagleHeavyLiftTechnologiesIncUsCart2 = (
customerId?: string
): TCartDraftBuilder =>
Expand All @@ -63,6 +71,9 @@ const eagleHeavyLiftTechnologiesIncUsCart2 = (
.shippingMethod(
KeyReferenceDraft.presets.shippingMethod().key(shippingMethod.key!)
)
.store(KeyReferenceDraft.presets.store().key(store.key!));
.store(KeyReferenceDraft.presets.store().key(store.key!))
.businessUnit(
KeyReferenceDraft.presets.businessUnit().key(businessUnit.key!)
);

export default eagleHeavyLiftTechnologiesIncUsCart2;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ describe(`with libertyCraneSolutionsLlcUsCart1 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "liberty-crane-solutions-llc-us",
"typeId": "business-unit",
},
"country": "US",
"currency": "USD",
"custom": undefined,
Expand Down Expand Up @@ -126,7 +129,10 @@ describe(`with libertyCraneSolutionsLlcUsCart1 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "liberty-crane-solutions-llc-us",
"typeId": "business-unit",
},
"country": "US",
"currency": "USD",
"custom": undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
CompanyDraft,
type TCompanyDraft,
} from '@commercetools-test-data/business-unit';
import {
AddressDraft,
KeyReferenceDraft,
Expand Down Expand Up @@ -43,6 +47,10 @@ const store = StoreDraft.presets.sampleDataB2B
.usMediumCustomers()
.build<TStoreDraft>();

const businessUnit = CompanyDraft.presets.sampleDataB2B
.libertyCraneSolutionsLlcUs()
.build<TCompanyDraft>();

const libertyCraneSolutionsLlcUsCart1 = (
customerId?: string
): TCartDraftBuilder =>
Expand All @@ -63,6 +71,9 @@ const libertyCraneSolutionsLlcUsCart1 = (
.shippingMethod(
KeyReferenceDraft.presets.shippingMethod().key(shippingMethod.key!)
)
.store(KeyReferenceDraft.presets.store().key(store.key!));
.store(KeyReferenceDraft.presets.store().key(store.key!))
.businessUnit(
KeyReferenceDraft.presets.businessUnit().key(businessUnit.key!)
);

export default libertyCraneSolutionsLlcUsCart1;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ describe(`with libertyCraneSolutionsLlcUsCart2 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "liberty-crane-solutions-llc-us",
"typeId": "business-unit",
},
"country": "US",
"currency": "USD",
"custom": undefined,
Expand Down Expand Up @@ -126,7 +129,10 @@ describe(`with libertyCraneSolutionsLlcUsCart2 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "liberty-crane-solutions-llc-us",
"typeId": "business-unit",
},
"country": "US",
"currency": "USD",
"custom": undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
CompanyDraft,
type TCompanyDraft,
} from '@commercetools-test-data/business-unit';
import {
AddressDraft,
KeyReferenceDraft,
Expand Down Expand Up @@ -43,6 +47,10 @@ const store = StoreDraft.presets.sampleDataB2B
.usMediumCustomers()
.build<TStoreDraft>();

const businessUnit = CompanyDraft.presets.sampleDataB2B
.libertyCraneSolutionsLlcUs()
.build<TCompanyDraft>();

const libertyCraneSolutionsLlcUsCart2 = (
customerId?: string
): TCartDraftBuilder =>
Expand All @@ -63,6 +71,9 @@ const libertyCraneSolutionsLlcUsCart2 = (
.shippingMethod(
KeyReferenceDraft.presets.shippingMethod().key(shippingMethod.key!)
)
.store(KeyReferenceDraft.presets.store().key(store.key!));
.store(KeyReferenceDraft.presets.store().key(store.key!))
.businessUnit(
KeyReferenceDraft.presets.businessUnit().key(businessUnit.key!)
);

export default libertyCraneSolutionsLlcUsCart2;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ describe(`with lifttechSolutionsLtdCart1 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"country": "GB",
"currency": "GBP",
"custom": undefined,
Expand Down Expand Up @@ -126,7 +129,10 @@ describe(`with lifttechSolutionsLtdCart1 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"country": "GB",
"currency": "GBP",
"custom": undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
CompanyDraft,
type TCompanyDraft,
} from '@commercetools-test-data/business-unit';
import {
AddressDraft,
KeyReferenceDraft,
Expand Down Expand Up @@ -41,6 +45,10 @@ const shippingMethod = ShippingMethodDraft.presets.sampleDataB2B

const store = StoreDraft.presets.sampleDataB2B.deFrUk().build<TStoreDraft>();

const businessUnit = CompanyDraft.presets.sampleDataB2B
.lifttechSolutionsLtd()
.build<TCompanyDraft>();

const lifttechSolutionsLtdCart1 = (customerId?: string): TCartDraftBuilder =>
CartDraft.presets
.empty()
Expand All @@ -59,6 +67,9 @@ const lifttechSolutionsLtdCart1 = (customerId?: string): TCartDraftBuilder =>
.shippingMethod(
KeyReferenceDraft.presets.shippingMethod().key(shippingMethod.key!)
)
.store(KeyReferenceDraft.presets.store().key(store.key!));
.store(KeyReferenceDraft.presets.store().key(store.key!))
.businessUnit(
KeyReferenceDraft.presets.businessUnit().key(businessUnit.key!)
);

export default lifttechSolutionsLtdCart1;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ describe(`with lifttechSolutionsLtdCart2 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"country": "GB",
"currency": "GBP",
"custom": undefined,
Expand Down Expand Up @@ -126,7 +129,10 @@ describe(`with lifttechSolutionsLtdCart2 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"country": "GB",
"currency": "GBP",
"custom": undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
CompanyDraft,
type TCompanyDraft,
} from '@commercetools-test-data/business-unit';
import {
AddressDraft,
KeyReferenceDraft,
Expand Down Expand Up @@ -41,6 +45,10 @@ const shippingMethod = ShippingMethodDraft.presets.sampleDataB2B

const store = StoreDraft.presets.sampleDataB2B.deFrUk().build<TStoreDraft>();

const businessUnit = CompanyDraft.presets.sampleDataB2B
.lifttechSolutionsLtd()
.build<TCompanyDraft>();

const lifttechSolutionsLtdCart2 = (customerId?: string): TCartDraftBuilder =>
CartDraft.presets
.empty()
Expand All @@ -59,6 +67,9 @@ const lifttechSolutionsLtdCart2 = (customerId?: string): TCartDraftBuilder =>
.shippingMethod(
KeyReferenceDraft.presets.shippingMethod().key(shippingMethod.key!)
)
.store(KeyReferenceDraft.presets.store().key(store.key!));
.store(KeyReferenceDraft.presets.store().key(store.key!))
.businessUnit(
KeyReferenceDraft.presets.businessUnit().key(businessUnit.key!)
);

export default lifttechSolutionsLtdCart2;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ describe(`with lifttechSolutionsLtdDeCart1 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "lifttech-solutions-ltd-de",
"typeId": "business-unit",
},
"country": "DE",
"currency": "EUR",
"custom": undefined,
Expand Down Expand Up @@ -126,7 +129,10 @@ describe(`with lifttechSolutionsLtdDeCart1 preset`, () => {
{
"anonymousId": undefined,
"billingAddress": undefined,
"businessUnit": undefined,
"businessUnit": {
"key": "lifttech-solutions-ltd-de",
"typeId": "business-unit",
},
"country": "DE",
"currency": "EUR",
"custom": undefined,
Expand Down
Loading

0 comments on commit 09edcba

Please sign in to comment.