@@ -1487,4 +1487,52 @@ describe('run', () => {
14871487 expect ( mockRuntimeLib . deployActions ) . toHaveBeenCalledTimes ( 1 )
14881488 expect ( mockWebLib . deployWeb ) . toHaveBeenCalledTimes ( 1 )
14891489 } )
1490+
1491+ test ( 'Should deploy successfully even if Audit log service is unavailable (--verbose)' , async ( ) => {
1492+ const mockToken = 'mocktoken'
1493+ const mockEnv = 'stage'
1494+ const mockOrg = 'mockorg'
1495+ const mockProject = 'mockproject'
1496+ const mockWorkspaceId = 'mockworkspaceid'
1497+ const mockWorkspaceName = 'mockworkspacename'
1498+ helpers . getCliInfo . mockResolvedValueOnce ( {
1499+ accessToken : mockToken ,
1500+ env : mockEnv
1501+ } )
1502+ command . getFullConfig = jest . fn ( ) . mockReturnValue ( {
1503+ aio : {
1504+ project : {
1505+ id : mockProject ,
1506+ org : {
1507+ id : mockOrg
1508+ } ,
1509+ workspace : {
1510+ id : mockWorkspaceId ,
1511+ name : mockWorkspaceName
1512+ }
1513+ }
1514+ }
1515+ } )
1516+
1517+ auditLogger . sendAuditLogs . mockRejectedValue ( {
1518+ message : 'Internal Server Error' ,
1519+ status : 500
1520+ } )
1521+
1522+ command . getAppExtConfigs . mockResolvedValueOnce ( createAppConfig ( command . appConfig ) )
1523+
1524+ command . argv = [ '--verbose' ]
1525+ await command . run ( )
1526+ expect ( command . log ) . toHaveBeenCalledWith (
1527+ expect . stringContaining ( 'skipping publish phase...' )
1528+ )
1529+
1530+ expect ( command . log ) . toHaveBeenCalledWith (
1531+ expect . stringContaining ( 'Successful deployment 🏄' )
1532+ )
1533+ expect ( auditLogger . sendAuditLogs ) . toHaveBeenCalledTimes ( 1 )
1534+ expect ( command . error ) . toHaveBeenCalledTimes ( 0 )
1535+ expect ( mockRuntimeLib . deployActions ) . toHaveBeenCalledTimes ( 1 )
1536+ expect ( mockWebLib . deployWeb ) . toHaveBeenCalledTimes ( 1 )
1537+ } )
14901538} )
0 commit comments