@@ -804,6 +804,98 @@ describe('OptionsListUtils', () => {
804804 // Then the result should include the admin room
805805 expect ( adminRoomOption ) . toBeDefined ( ) ;
806806 } ) ;
807+
808+ it ( 'should include brickRoadIndicator if showRBR is true' , ( ) => {
809+ const reportID = '1455140530846319' ;
810+ const workspaceChat : SearchOption < Report > = {
811+ item : {
812+ chatType : CONST . REPORT . CHAT_TYPE . POLICY_EXPENSE_CHAT ,
813+ currency : 'USD' ,
814+ errorFields : { } ,
815+ lastActionType : 'CREATED' ,
816+ lastReadTime : '2025-03-21 07:25:46.279' ,
817+ lastVisibleActionCreated : '2024-12-15 21:13:24.317' ,
818+ lastVisibleActionLastModified : '2024-12-15 21:13:24.317' ,
819+ ownerAccountID : 0 ,
820+ permissions : [ 'read' , 'write' ] ,
821+ participants : { 1 : { notificationPreference : 'always' } } ,
822+ policyID : '52A5ABD88FBBD18F' ,
823+ policyName : "A's Workspace" ,
824+ reportID,
825+ reportName : "A's Workspace chat" ,
826+ type : 'chat' ,
827+ writeCapability : 'all' ,
828+ } ,
829+ text : "A's Workspace chat" ,
830+ alternateText : "A's Workspace" ,
831+ allReportErrors : { } ,
832+ subtitle : "A's Workspace" ,
833+ participantsList : [ ] ,
834+ reportID,
835+ keyForList : '1455140530846319' ,
836+ isDefaultRoom : true ,
837+ isChatRoom : true ,
838+ policyID : '52A5ABD88FBBD18F' ,
839+ lastMessageText : '' ,
840+ lastVisibleActionCreated : '2024-12-15 21:13:24.317' ,
841+ notificationPreference : 'hidden' ,
842+ brickRoadIndicator : CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR ,
843+ } ;
844+ const results = getValidOptions (
845+ { reports : [ workspaceChat ] , personalDetails : [ ] } ,
846+ {
847+ includeMultipleParticipantReports : true ,
848+ showRBR : true ,
849+ } ,
850+ ) ;
851+ expect ( results . recentReports . at ( 0 ) ?. brickRoadIndicator ) . toBe ( CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR ) ;
852+ } ) ;
853+
854+ it ( 'should not include brickRoadIndicator if showRBR is false' , ( ) => {
855+ const reportID = '1455140530846319' ;
856+ const workspaceChat : SearchOption < Report > = {
857+ item : {
858+ chatType : CONST . REPORT . CHAT_TYPE . POLICY_EXPENSE_CHAT ,
859+ currency : 'USD' ,
860+ errorFields : { } ,
861+ lastActionType : 'CREATED' ,
862+ lastReadTime : '2025-03-21 07:25:46.279' ,
863+ lastVisibleActionCreated : '2024-12-15 21:13:24.317' ,
864+ lastVisibleActionLastModified : '2024-12-15 21:13:24.317' ,
865+ ownerAccountID : 0 ,
866+ permissions : [ 'read' , 'write' ] ,
867+ participants : { 1 : { notificationPreference : 'always' } } ,
868+ policyID : '52A5ABD88FBBD18F' ,
869+ policyName : "A's Workspace" ,
870+ reportID,
871+ reportName : "A's Workspace chat" ,
872+ type : 'chat' ,
873+ writeCapability : 'all' ,
874+ } ,
875+ text : "A's Workspace chat" ,
876+ alternateText : "A's Workspace" ,
877+ allReportErrors : { } ,
878+ subtitle : "A's Workspace" ,
879+ participantsList : [ ] ,
880+ reportID,
881+ keyForList : '1455140530846319' ,
882+ isDefaultRoom : true ,
883+ isChatRoom : true ,
884+ policyID : '52A5ABD88FBBD18F' ,
885+ lastMessageText : '' ,
886+ lastVisibleActionCreated : '2024-12-15 21:13:24.317' ,
887+ notificationPreference : 'hidden' ,
888+ brickRoadIndicator : CONST . BRICK_ROAD_INDICATOR_STATUS . ERROR ,
889+ } ;
890+ const results = getValidOptions (
891+ { reports : [ workspaceChat ] , personalDetails : [ ] } ,
892+ {
893+ includeMultipleParticipantReports : true ,
894+ showRBR : false ,
895+ } ,
896+ ) ;
897+ expect ( results . recentReports . at ( 0 ) ?. brickRoadIndicator ) . toBe ( null ) ;
898+ } ) ;
807899 } ) ;
808900
809901 describe ( 'getValidOptions() for chat room' , ( ) => {
0 commit comments