@@ -2763,6 +2763,82 @@ describe('Config Tests', () => {
27632763 } ) ;
27642764 } ) ;
27652765
2766+ describe ( 'Commerce LLMO Config' , ( ) => {
2767+ it ( 'creates a Config with commerceLlmoConfig property' , ( ) => {
2768+ const data = {
2769+ commerceLlmoConfig : {
2770+ store1 : {
2771+ environmentId : 'env-123' ,
2772+ websiteCode : 'base' ,
2773+ storeCode : 'main_store' ,
2774+ storeViewCode : 'default' ,
2775+ hostName : 'example.com' ,
2776+ magentoEndpoint : 'https://magento.example.com/graphql' ,
2777+ magentoAPIKey : 'api-key-123' ,
2778+ } ,
2779+ } ,
2780+ } ;
2781+ const config = Config ( data ) ;
2782+ expect ( config . getCommerceLlmoConfig ( ) ) . to . deep . equal ( data . commerceLlmoConfig ) ;
2783+ } ) ;
2784+
2785+ it ( 'has undefined commerceLlmoConfig in default config' , ( ) => {
2786+ const config = Config ( ) ;
2787+ expect ( config . getCommerceLlmoConfig ( ) ) . to . be . undefined ;
2788+ } ) ;
2789+
2790+ it ( 'should return undefined for commerceLlmoConfig if not provided' , ( ) => {
2791+ const config = Config ( { } ) ;
2792+ expect ( config . getCommerceLlmoConfig ( ) ) . to . be . undefined ;
2793+ } ) ;
2794+
2795+ it ( 'should be able to update commerceLlmoConfig' , ( ) => {
2796+ const data = {
2797+ commerceLlmoConfig : {
2798+ store1 : {
2799+ environmentId : 'env-456' ,
2800+ websiteCode : 'base' ,
2801+ } ,
2802+ } ,
2803+ } ;
2804+ const config = Config ( { } ) ;
2805+ config . updateCommerceLlmoConfig ( data . commerceLlmoConfig ) ;
2806+ expect ( config . getCommerceLlmoConfig ( ) ) . to . deep . equal ( data . commerceLlmoConfig ) ;
2807+ } ) ;
2808+
2809+ it ( 'should be able to update commerceLlmoConfig with different values' , ( ) => {
2810+ const config = Config ( {
2811+ commerceLlmoConfig : {
2812+ store1 : {
2813+ environmentId : 'env-123' ,
2814+ } ,
2815+ } ,
2816+ } ) ;
2817+
2818+ const newConfig = {
2819+ store2 : {
2820+ environmentId : 'env-789' ,
2821+ hostName : 'new.example.com' ,
2822+ } ,
2823+ } ;
2824+ config . updateCommerceLlmoConfig ( newConfig ) ;
2825+ expect ( config . getCommerceLlmoConfig ( ) ) . to . deep . equal ( newConfig ) ;
2826+ } ) ;
2827+
2828+ it ( 'includes commerceLlmoConfig in toDynamoItem conversion' , ( ) => {
2829+ const data = Config ( {
2830+ commerceLlmoConfig : {
2831+ store1 : {
2832+ environmentId : 'env-123' ,
2833+ magentoEndpoint : 'https://magento.example.com/graphql' ,
2834+ } ,
2835+ } ,
2836+ } ) ;
2837+ const dynamoItem = Config . toDynamoItem ( data ) ;
2838+ expect ( dynamoItem . commerceLlmoConfig ) . to . deep . equal ( data . getCommerceLlmoConfig ( ) ) ;
2839+ } ) ;
2840+ } ) ;
2841+
27662842 describe ( 'LLMO Well Known Tags' , ( ) => {
27672843 const { extractWellKnownTags } = Config ( ) ;
27682844
0 commit comments