Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions packages/organization-config/src/getMfeConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,68 @@ describe("getMfeConfig function", () => {
expect(config?.language).toBe("en-US")
})

it("should handle hide item code on checkout", () => {
const config = getMfeConfig({
jsonConfig: {
mfe: {
default: {
checkout: {
hide_item_codes: true,
},
},
},
},
})
expect(config?.checkout?.hide_item_codes).toBe(true)
})

it("should handle hide item code on cart", () => {
const config = getMfeConfig({
jsonConfig: {
mfe: {
default: {
cart: {
hide_item_codes: true,
},
},
},
},
})
expect(config?.cart?.hide_item_codes).toBe(true)
})

it("should handle hide item code on microstore", () => {
const config = getMfeConfig({
jsonConfig: {
mfe: {
default: {
microstore: {
hide_item_codes: true,
},
},
},
},
})
expect(config?.microstore?.hide_item_codes).toBe(true)
})

it("should handle hide item code on my-account and hide returns", () => {
const config = getMfeConfig({
jsonConfig: {
mfe: {
default: {
my_account: {
hide_item_codes: true,
hide_returns: true,
},
},
},
},
})
expect(config?.my_account?.hide_item_codes).toBe(true)
expect(config?.my_account?.hide_returns).toBe(true)
})

it("should handle language as market override", () => {
const config = getMfeConfig({
jsonConfig: {
Expand Down
20 changes: 20 additions & 0 deletions packages/organization-config/src/schema/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export interface MfeConfig {
* Settings for the Checkout micro front end.
*/
checkout?: {
hide_item_codes?: boolean
thankyou_page?: Url
optional_billing_info?: boolean
billing_countries?: StateCountry
Expand All @@ -106,6 +107,25 @@ export interface MfeConfig {
[k: string]: StateCountry3
}
}
/**
* Settings for the Cart micro front end.
*/
cart?: {
hide_item_codes?: boolean
}
/**
* Settings for the microstore micro front end.
*/
microstore?: {
hide_item_codes?: boolean
}
/**
* Settings for the my-account micro front end.
*/
my_account?: {
hide_item_codes?: boolean
hide_returns?: boolean
}
/**
* Checkout internal links settings.
*/
Expand Down