@@ -310,6 +310,75 @@ describe('utils/helpers.ts', () => {
310310 ) ;
311311 } ) ;
312312
313+ describe ( 'Workflow Run URLs' , ( ) => {
314+ it ( 'approval requested' , async ( ) => {
315+ const subject = {
316+ title : 'some-user requested your review to deploy to an environment' ,
317+ url : null ,
318+ latest_comment_url : null ,
319+ type : 'WorkflowRun' as SubjectType ,
320+ } ;
321+
322+ const result = await generateGitHubWebUrl (
323+ {
324+ ...mockedSingleNotification ,
325+ subject : subject ,
326+ } ,
327+ mockAccounts ,
328+ ) ;
329+
330+ expect ( apiRequestAuthMock ) . toHaveBeenCalledTimes ( 0 ) ;
331+ expect ( result ) . toBe (
332+ `https://github.com/manosim/notifications-test/actions?query=is%3Awaiting&${ mockedNotificationReferrer } ` ,
333+ ) ;
334+ } ) ;
335+
336+ it ( 'unhandled status/action scenario' , async ( ) => {
337+ const subject = {
338+ title :
339+ 'some-user requested your unhandled-action to deploy to an environment' ,
340+ url : null ,
341+ latest_comment_url : null ,
342+ type : 'WorkflowRun' as SubjectType ,
343+ } ;
344+
345+ const result = await generateGitHubWebUrl (
346+ {
347+ ...mockedSingleNotification ,
348+ subject : subject ,
349+ } ,
350+ mockAccounts ,
351+ ) ;
352+
353+ expect ( apiRequestAuthMock ) . toHaveBeenCalledTimes ( 0 ) ;
354+ expect ( result ) . toBe (
355+ `https://github.com/manosim/notifications-test/actions?${ mockedNotificationReferrer } ` ,
356+ ) ;
357+ } ) ;
358+
359+ it ( 'unhandled workflow scenario' , async ( ) => {
360+ const subject = {
361+ title : 'some unhandled scenario' ,
362+ url : null ,
363+ latest_comment_url : null ,
364+ type : 'WorkflowRun' as SubjectType ,
365+ } ;
366+
367+ const result = await generateGitHubWebUrl (
368+ {
369+ ...mockedSingleNotification ,
370+ subject : subject ,
371+ } ,
372+ mockAccounts ,
373+ ) ;
374+
375+ expect ( apiRequestAuthMock ) . toHaveBeenCalledTimes ( 0 ) ;
376+ expect ( result ) . toBe (
377+ `https://github.com/manosim/notifications-test/actions?${ mockedNotificationReferrer } ` ,
378+ ) ;
379+ } ) ;
380+ } ) ;
381+
313382 it ( 'defaults to repository url' , async ( ) => {
314383 const subject = {
315384 title : 'generate github web url unit tests' ,
0 commit comments