@@ -1391,6 +1391,38 @@ describe('TransactionUtils', () => {
13911391 } ) ;
13921392 } ) ;
13931393
1394+ describe ( 'getAttendeesListDisplayString' , ( ) => {
1395+ it ( 'returns attendees alphabetically regardless of insertion order (deploy blocker #89130)' , ( ) => {
1396+ const attendees : Attendee [ ] = [
1397+ { email : 'b@x.com' , displayName : 'banana' , avatarUrl : '' , login : 'b@x.com' } ,
1398+ { email : 'a@x.com' , displayName : 'apple' , avatarUrl : '' , login : 'a@x.com' } ,
1399+ ] ;
1400+ expect ( TransactionUtils . getAttendeesListDisplayString ( attendees ) ) . toBe ( 'apple, banana' ) ;
1401+ } ) ;
1402+
1403+ it ( 'uses numeric-aware sort so "User 9" comes before "User 10"' , ( ) => {
1404+ const attendees : Attendee [ ] = [
1405+ { email : '10@x.com' , displayName : 'User 10' , avatarUrl : '' , login : '10@x.com' } ,
1406+ { email : '9@x.com' , displayName : 'User 9' , avatarUrl : '' , login : '9@x.com' } ,
1407+ ] ;
1408+ expect ( TransactionUtils . getAttendeesListDisplayString ( attendees ) ) . toBe ( 'User 9, User 10' ) ;
1409+ } ) ;
1410+
1411+ it ( 'returns empty string for empty array' , ( ) => {
1412+ expect ( TransactionUtils . getAttendeesListDisplayString ( [ ] ) ) . toBe ( '' ) ;
1413+ } ) ;
1414+
1415+ it ( 'does not mutate the input array' , ( ) => {
1416+ const attendees : Attendee [ ] = [
1417+ { email : 'b@x.com' , displayName : 'banana' , avatarUrl : '' , login : 'b@x.com' } ,
1418+ { email : 'a@x.com' , displayName : 'apple' , avatarUrl : '' , login : 'a@x.com' } ,
1419+ ] ;
1420+ const snapshot = [ ...attendees ] ;
1421+ TransactionUtils . getAttendeesListDisplayString ( attendees ) ;
1422+ expect ( attendees ) . toEqual ( snapshot ) ;
1423+ } ) ;
1424+ } ) ;
1425+
13941426 describe ( 'isCategoryBeingAnalyzed' , ( ) => {
13951427 it ( 'should return false for undefined transaction' , ( ) => {
13961428 expect ( TransactionUtils . isCategoryBeingAnalyzed ( undefined ) ) . toBe ( false ) ;
0 commit comments