@@ -1247,7 +1247,7 @@ describe('getSecondaryExportReportActions', () => {
12471247 expect ( result . includes ( CONST . REPORT . EXPORT_OPTIONS . MARK_AS_EXPORTED ) ) . toBe ( true ) ;
12481248 } ) ;
12491249
1250- it ( 'includes REMOVE HOLD option for expense report admin ' , ( ) => {
1250+ it ( 'includes REMOVE HOLD option for admin if he is not the holder ' , ( ) => {
12511251 const report = { } as unknown as Report ;
12521252 const policy = {
12531253 role : CONST . POLICY . ROLE . ADMIN ,
@@ -1266,27 +1266,6 @@ describe('getSecondaryExportReportActions', () => {
12661266 const result = getSecondaryReportActions ( { report, chatReport, reportTransactions, violations : { } , policy} ) ;
12671267 expect ( result ) . toContain ( CONST . REPORT . SECONDARY_ACTIONS . REMOVE_HOLD ) ;
12681268 } ) ;
1269-
1270- it ( 'includes REMOVE HOLD option for transaction thread report admin if he is not the holder' , ( ) => {
1271- const report = { } as unknown as Report ;
1272- const policy = {
1273- role : CONST . POLICY . ROLE . ADMIN ,
1274- } as unknown as Policy ;
1275- const transaction = {
1276- comment : {
1277- hold : 'REPORT_ACTION_ID' ,
1278- } ,
1279- } as unknown as Transaction ;
1280-
1281- jest . spyOn ( ReportUtils , 'isHoldCreator' ) . mockReturnValue ( false ) ;
1282- const result = getSecondaryTransactionThreadActions ( report , transaction , [ ] , policy ) ;
1283- expect ( result ) . toContain ( CONST . REPORT . SECONDARY_ACTIONS . REMOVE_HOLD ) ;
1284-
1285- // Do not show if admin is the holder
1286- jest . spyOn ( ReportUtils , 'isHoldCreator' ) . mockReturnValue ( true ) ;
1287- const result2 = getSecondaryTransactionThreadActions ( report , transaction , [ ] , policy ) ;
1288- expect ( result2 ) . not . toContain ( CONST . REPORT . SECONDARY_ACTIONS . REMOVE_HOLD ) ;
1289- } ) ;
12901269} ) ;
12911270
12921271describe ( 'getSecondaryTransactionThreadActions' , ( ) => {
@@ -1331,6 +1310,27 @@ describe('getSecondaryTransactionThreadActions', () => {
13311310 expect ( result . includes ( CONST . REPORT . SECONDARY_ACTIONS . HOLD ) ) . toBe ( true ) ;
13321311 } ) ;
13331312
1313+ it ( 'includes REMOVE HOLD option for transaction thread report admin if he is not the holder' , ( ) => {
1314+ const report = { } as unknown as Report ;
1315+ const policy = {
1316+ role : CONST . POLICY . ROLE . ADMIN ,
1317+ } as unknown as Policy ;
1318+ const transaction = {
1319+ comment : {
1320+ hold : 'REPORT_ACTION_ID' ,
1321+ } ,
1322+ } as unknown as Transaction ;
1323+
1324+ jest . spyOn ( ReportUtils , 'isHoldCreator' ) . mockReturnValue ( false ) ;
1325+ const result = getSecondaryTransactionThreadActions ( report , transaction , [ ] , policy ) ;
1326+ expect ( result ) . toContain ( CONST . REPORT . SECONDARY_ACTIONS . REMOVE_HOLD ) ;
1327+
1328+ // Do not show if admin is the holder
1329+ jest . spyOn ( ReportUtils , 'isHoldCreator' ) . mockReturnValue ( true ) ;
1330+ const result2 = getSecondaryTransactionThreadActions ( report , transaction , [ ] , policy ) ;
1331+ expect ( result2 ) . not . toContain ( CONST . REPORT . SECONDARY_ACTIONS . REMOVE_HOLD ) ;
1332+ } ) ;
1333+
13341334 it ( 'includes DELETE option for expense report submitter' , async ( ) => {
13351335 const report = {
13361336 reportID : REPORT_ID ,
0 commit comments