@@ -183,7 +183,7 @@ describe('ExperienceSiteMigration', () => {
183183
184184 processFileStub . onCall ( 0 ) . returns ( {
185185 name : 'site1.json' ,
186- hasOmnistudioContent : true ,
186+ hasOmnistudioContentWithChanges : true ,
187187 warnings : [ ] ,
188188 infos : [ ] ,
189189 path : '/test/path/site1.json' ,
@@ -193,7 +193,7 @@ describe('ExperienceSiteMigration', () => {
193193 } ) ;
194194 processFileStub . onCall ( 1 ) . returns ( {
195195 name : 'site3.json' ,
196- hasOmnistudioContent : false ,
196+ hasOmnistudioContentWithChanges : false ,
197197 warnings : [ ] ,
198198 infos : [ ] ,
199199 path : '/test/path/site3.json' ,
@@ -208,7 +208,7 @@ describe('ExperienceSiteMigration', () => {
208208 // Assert
209209 expect ( fileUtilStub . calledOnce ) . to . be . true ;
210210 expect ( processFileStub . calledTwice ) . to . be . true ; // Only called for JSON files
211- expect ( result ) . to . have . length ( 1 ) ; // Only files with hasOmnistudioContent : true
211+ expect ( result ) . to . have . length ( 1 ) ; // Only files with hasOmnistudioContentWithChanges : true
212212 expect ( result [ 0 ] . experienceSiteAssessmentPageInfos [ 0 ] . name ) . to . equal ( 'site1.json' ) ;
213213 } ) ;
214214
@@ -229,7 +229,7 @@ describe('ExperienceSiteMigration', () => {
229229 expect ( result [ 0 ] . experienceSiteAssessmentPageInfos [ 0 ] . name ) . to . equal ( 'error.json' ) ;
230230 expect ( result [ 0 ] . experienceSiteAssessmentPageInfos [ 0 ] . status ) . to . equal ( 'Failed' ) ;
231231 expect ( result [ 0 ] . experienceSiteAssessmentPageInfos [ 0 ] . warnings ) . to . include ( 'Unknown error occurred' ) ;
232- expect ( result [ 0 ] . experienceSiteAssessmentPageInfos [ 0 ] . hasOmnistudioContent ) . to . be . false ;
232+ expect ( result [ 0 ] . experienceSiteAssessmentPageInfos [ 0 ] . hasOmnistudioContentWithChanges ) . to . be . false ;
233233 expect ( ( Logger . error as sinon . SinonStub ) . called ) . to . be . true ;
234234 } ) ;
235235 } ) ;
@@ -256,7 +256,11 @@ describe('ExperienceSiteMigration', () => {
256256 sinon . stub ( require ( 'fs' ) , 'writeFileSync' ) . value ( fsWriteStub ) ;
257257
258258 storageUtilStub = sinon . stub ( StorageUtil , 'getOmnistudioMigrationStorage' ) ;
259- sinon . stub ( FileDiffUtil . prototype , 'getFileDiff' ) . returns ( [ ] ) ;
259+ // Mock FileDiffUtil to return a non-empty diff (indicating changes were made)
260+ sinon . stub ( FileDiffUtil . prototype , 'getFileDiff' ) . returns ( [
261+ { old : 'line1' , new : 'line1' } ,
262+ { old : 'oldline' , new : 'newline' } ,
263+ ] ) ;
260264 } ) ;
261265
262266 it ( 'should replace vlocityLWCOmniWrapper component with runtime_omnistudio_omniscript' , ( ) => {
@@ -286,7 +290,7 @@ describe('ExperienceSiteMigration', () => {
286290 const result = experienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
287291
288292 // Assert
289- expect ( result . hasOmnistudioContent ) . to . be . true ;
293+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
290294 expect ( fsWriteStub . calledOnce ) . to . be . true ;
291295
292296 // Verify the file content was updated
@@ -303,19 +307,19 @@ describe('ExperienceSiteMigration', () => {
303307 expect ( component . componentAttributes . theme ) . to . equal ( 'lightning' ) ; // Preserved from original layout
304308 } ) ;
305309
306- it ( 'should return hasOmnistudioContent false when no vlocityLWCOmniWrapper found' , ( ) => {
310+ it ( 'should return hasOmnistudioContentWithChanges false when no vlocityLWCOmniWrapper found' , ( ) => {
307311 // Arrange
308312 fsReadStub . returns ( JSON . stringify ( sampleExperienceSiteJsonWithoutWrapper ) ) ;
309313
310314 // Act
311315 const result = experienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
312316
313317 // Assert
314- expect ( result . hasOmnistudioContent ) . to . be . false ;
318+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . false ;
315319 expect ( fsWriteStub . called ) . to . be . false ; // No changes made
316320 } ) ;
317321
318- it ( 'should return hasOmnistudioContent false when regions are undefined' , ( ) => {
322+ it ( 'should return hasOmnistudioContentWithChanges false when regions are undefined' , ( ) => {
319323 // Arrange
320324 const siteWithoutRegions = { ...sampleExperienceSiteJson , regions : undefined } ;
321325 fsReadStub . returns ( JSON . stringify ( siteWithoutRegions ) ) ;
@@ -324,7 +328,7 @@ describe('ExperienceSiteMigration', () => {
324328 const result = experienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
325329
326330 // Assert
327- expect ( result . hasOmnistudioContent ) . to . be . false ;
331+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . false ;
328332 expect ( fsWriteStub . called ) . to . be . false ;
329333 } ) ;
330334
@@ -342,7 +346,7 @@ describe('ExperienceSiteMigration', () => {
342346 const result = experienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
343347
344348 // Assert
345- expect ( result . hasOmnistudioContent ) . to . be . true ;
349+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
346350 expect ( result . warnings ) . to . have . length ( 1 ) ;
347351 expect ( result . warnings [ 0 ] ) . to . include ( 'TestSubtype:English Needs manual intervention' ) ;
348352 } ) ;
@@ -374,7 +378,7 @@ describe('ExperienceSiteMigration', () => {
374378 const result = experienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
375379
376380 // Assert
377- expect ( result . hasOmnistudioContent ) . to . be . true ;
381+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
378382 expect ( result . warnings ) . to . have . length ( 1 ) ;
379383 } ) ;
380384
@@ -405,7 +409,7 @@ describe('ExperienceSiteMigration', () => {
405409 const result = experienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
406410
407411 // Assert
408- expect ( result . hasOmnistudioContent ) . to . be . true ;
412+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
409413 expect ( result . warnings ) . to . have . length ( 1 ) ;
410414 expect ( result . warnings [ 0 ] ) . to . include ( 'Needs manual intervention as duplicated key found' ) ;
411415 } ) ;
@@ -427,7 +431,7 @@ describe('ExperienceSiteMigration', () => {
427431 const result = experienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
428432
429433 // Assert
430- expect ( result . hasOmnistudioContent ) . to . be . true ;
434+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
431435 expect ( result . warnings ) . to . have . length ( 1 ) ;
432436 expect ( result . warnings [ 0 ] ) . to . include ( 'The Target Name is empty. Check your Experience Cloud site configuration' ) ;
433437 } ) ;
@@ -450,7 +454,7 @@ describe('ExperienceSiteMigration', () => {
450454 const result = experienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
451455
452456 // Assert
453- expect ( result . hasOmnistudioContent ) . to . be . true ;
457+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
454458 // Should not throw an error and continue processing
455459 } ) ;
456460
@@ -514,7 +518,11 @@ describe('ExperienceSiteMigration', () => {
514518 sinon . stub ( require ( 'fs' ) , 'writeFileSync' ) . value ( fsWriteStub ) ;
515519
516520 storageUtilStub = sinon . stub ( StorageUtil , 'getOmnistudioAssessmentStorage' ) ;
517- sinon . stub ( FileDiffUtil . prototype , 'getFileDiff' ) . returns ( [ ] ) ;
521+ // Mock FileDiffUtil to return a non-empty diff (indicating changes were made)
522+ sinon . stub ( FileDiffUtil . prototype , 'getFileDiff' ) . returns ( [
523+ { old : 'line1' , new : 'line1' } ,
524+ { old : 'oldline' , new : 'newline' } ,
525+ ] ) ;
518526 } ) ;
519527
520528 it ( 'should use assessment storage instead of migration storage in assess mode' , ( ) => {
@@ -545,7 +553,7 @@ describe('ExperienceSiteMigration', () => {
545553
546554 // Assert
547555 expect ( storageUtilStub . calledOnce ) . to . be . true ;
548- expect ( result . hasOmnistudioContent ) . to . be . true ;
556+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
549557 expect ( result . warnings ) . to . have . length ( 0 ) ;
550558 } ) ;
551559
@@ -564,7 +572,7 @@ describe('ExperienceSiteMigration', () => {
564572 const result = experienceSiteMigration . processExperienceSite ( mockFile , Assess ) ;
565573
566574 // Assert
567- expect ( result . hasOmnistudioContent ) . to . be . true ;
575+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
568576 expect ( result . warnings ) . to . have . length ( 1 ) ;
569577 expect ( result . warnings [ 0 ] ) . to . include ( 'TestSubtype:English Needs manual intervention' ) ;
570578 } ) ;
@@ -596,7 +604,7 @@ describe('ExperienceSiteMigration', () => {
596604 const result = experienceSiteMigration . processExperienceSite ( mockFile , Assess ) ;
597605
598606 // Assert
599- expect ( result . hasOmnistudioContent ) . to . be . true ;
607+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
600608 expect ( result . warnings ) . to . have . length ( 1 ) ;
601609 expect ( result . warnings [ 0 ] ) . to . include ( 'Needs manual intervention as migration failed' ) ;
602610 } ) ;
@@ -628,12 +636,12 @@ describe('ExperienceSiteMigration', () => {
628636 const result = experienceSiteMigration . processExperienceSite ( mockFile , Assess ) ;
629637
630638 // Assert
631- expect ( result . hasOmnistudioContent ) . to . be . true ;
639+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
632640 expect ( result . warnings ) . to . have . length ( 1 ) ;
633641 expect ( result . warnings [ 0 ] ) . to . include ( 'Needs manual intervention as duplicated key found' ) ;
634642 } ) ;
635643
636- it ( 'should return false for hasOmnistudioContent when no wrapper component found in assess mode' , ( ) => {
644+ it ( 'should return false for hasOmnistudioContentWithChanges when no wrapper component found in assess mode' , ( ) => {
637645 // Arrange
638646 const mockStorage : MigrationStorage = {
639647 osStorage : new Map < string , OmniScriptStorage > ( ) ,
@@ -647,7 +655,7 @@ describe('ExperienceSiteMigration', () => {
647655 const result = experienceSiteMigration . processExperienceSite ( mockFile , Assess ) ;
648656
649657 // Assert
650- expect ( result . hasOmnistudioContent ) . to . be . false ;
658+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . false ;
651659 expect ( result . warnings ) . to . have . length ( 0 ) ;
652660 expect ( fsWriteStub . called ) . to . be . false ;
653661 } ) ;
@@ -712,7 +720,7 @@ describe('ExperienceSiteMigration', () => {
712720 const result = experienceSiteMigration . processExperienceSite ( mockFile , Assess ) ;
713721
714722 // Assert
715- expect ( result . hasOmnistudioContent ) . to . be . true ;
723+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
716724 expect ( result . warnings ) . to . have . length ( 1 ) ; // Only the duplicate should generate a warning
717725 expect ( result . warnings [ 0 ] ) . to . include ( 'DuplicateSubtype:English' ) ;
718726 expect ( result . warnings [ 0 ] ) . to . include ( 'duplicated key found' ) ;
@@ -732,7 +740,7 @@ describe('ExperienceSiteMigration', () => {
732740 const result = experienceSiteMigration . processExperienceSite ( mockFile , Assess ) ;
733741
734742 // Assert
735- expect ( result . hasOmnistudioContent ) . to . be . true ;
743+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
736744 expect ( result . warnings ) . to . have . length ( 1 ) ;
737745 expect ( result . warnings [ 0 ] ) . to . include ( 'Needs manual intervention' ) ;
738746 expect ( result . status ) . to . equal ( 'Needs manual intervention' ) ;
@@ -782,7 +790,11 @@ describe('ExperienceSiteMigration', () => {
782790 sinon . stub ( require ( 'fs' ) , 'writeFileSync' ) . value ( fsWriteStub ) ;
783791
784792 storageUtilStub = sinon . stub ( StorageUtil , 'getOmnistudioMigrationStorage' ) ;
785- sinon . stub ( FileDiffUtil . prototype , 'getFileDiff' ) . returns ( [ ] ) ;
793+ // Mock FileDiffUtil to return a non-empty diff (indicating changes were made)
794+ sinon . stub ( FileDiffUtil . prototype , 'getFileDiff' ) . returns ( [
795+ { old : 'line1' , new : 'line1' } ,
796+ { old : 'oldline' , new : 'newline' } ,
797+ ] ) ;
786798 } ) ;
787799
788800 it ( 'should process standard data model OmniScript component successfully' , ( ) => {
@@ -838,7 +850,7 @@ describe('ExperienceSiteMigration', () => {
838850 const result = standardDataModelExperienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
839851
840852 // Assert
841- expect ( result . hasOmnistudioContent ) . to . be . true ;
853+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
842854 expect ( fsWriteStub . calledOnce ) . to . be . true ;
843855
844856 // Verify the file content was updated
@@ -889,7 +901,7 @@ describe('ExperienceSiteMigration', () => {
889901 const result = standardDataModelExperienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
890902
891903 // Assert
892- expect ( result . hasOmnistudioContent ) . to . be . true ;
904+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
893905 expect ( result . warnings ) . to . have . length ( 1 ) ;
894906 expect ( result . warnings [ 0 ] ) . to . include ( 'standard-test.json needs manual intervention for configuration' ) ;
895907 expect ( result . status ) . to . equal ( 'Skipped' ) ;
@@ -939,7 +951,7 @@ describe('ExperienceSiteMigration', () => {
939951 const result = standardDataModelExperienceSiteMigration . processExperienceSite ( mockFile , Migrate ) ;
940952
941953 // Assert
942- expect ( result . hasOmnistudioContent ) . to . be . true ;
954+ expect ( result . hasOmnistudioContentWithChanges ) . to . be . true ;
943955 expect ( fsWriteStub . calledOnce ) . to . be . true ;
944956
945957 // Verify the file content was updated
0 commit comments