@@ -589,6 +589,23 @@ describe("engine service", () => {
589589 delete process . env . ENGINE_NAME ;
590590 } ) ;
591591
592+ it ( "Parse engine statuses" , async ( ) => {
593+ // Taken from https://docs.firebolt.io/Overview/engine-fundamentals.html#viewing-and-understanding-engine-status
594+ const statuses = [
595+ [ "STARTING" , EngineStatusSummary . STARTING ] ,
596+ [ "RUNNING" , EngineStatusSummary . RUNNING ] ,
597+ [ "RESIZING" , EngineStatusSummary . RESIZING ] ,
598+ [ "DRAINING" , EngineStatusSummary . DRAINING ] ,
599+ [ "STOPPING" , EngineStatusSummary . STOPPING ] ,
600+ [ "STOPPED" , EngineStatusSummary . STOPPED ]
601+ ] ;
602+ for ( const [ rawStatus , status ] of statuses ) {
603+ expect ( processEngineStatus ( rawStatus ) ) . toEqual ( status ) ;
604+ }
605+ expect ( processEngineStatus ( undefined ) ) . toBe ( undefined ) ;
606+ expect ( processEngineStatus ( "unexisting" ) ) . not . toBeTruthy ( ) ;
607+ } ) ;
608+
592609 it ( "Parses different engine statuses correctly" , async ( ) => {
593610 const statuses = [ "RUNNING" , "Running" , "running" ] ;
594611 for ( const status of statuses ) {
0 commit comments