@@ -425,5 +425,38 @@ describe('locPageRules', () => {
425425
426426 expect ( result ) . to . deep . equal ( expected ) ;
427427 } ) ;
428+
429+ it ( 'should handle empty workflowName gracefully (bug fix for hash add4effe)' , ( ) => {
430+ // This tests the fix for the bug where empty workflowName created "WCMS/DX/"
431+ // instead of "WCMS/DX/Human Translation", causing hash add4effe
432+ const urls = [ '/page1' , '/page2' ] ;
433+
434+ const languageObjects = [
435+ { code : 'de' , workflow : 'WCMS/DX' , workflowName : 'Human Translation' } , // Valid
436+ { code : 'fr' , workflow : 'WCMS/DX' , workflowName : '' } , // Empty workflowName - should be skipped
437+ { code : 'ja' , workflow : 'WCMS/DX' , workflowName : undefined } , // Undefined - should be skipped
438+ { code : 'es' , workflow : '' , workflowName : 'Human Translation' } ,
439+ ] ;
440+
441+ const config = { } ;
442+
443+ const result = groupUrlsByWorkflow ( urls , languageObjects , config ) ;
444+
445+ // Only 'de' should be included, 'fr' and 'ja' should be skipped
446+ const expected = {
447+ 'WCMS/DX/Human Translation' : [
448+ {
449+ languages : [ 'de' ] ,
450+ urlPaths : [ '/page1' , '/page2' ] ,
451+ } ,
452+ ] ,
453+ } ;
454+
455+ expect ( result ) . to . deep . equal ( expected ) ;
456+
457+ // Verify that languages with empty/undefined workflowName are excluded
458+ expect ( result [ 'WCMS/DX/Human Translation' ] [ 0 ] . languages ) . to . not . include ( 'fr' ) ;
459+ expect ( result [ 'WCMS/DX/Human Translation' ] [ 0 ] . languages ) . to . not . include ( 'ja' ) ;
460+ } ) ;
428461 } ) ;
429462} ) ;
0 commit comments