@@ -26,14 +26,21 @@ describe('StatusNetworkService', () => {
2626 } ) ;
2727
2828 it ( 'checkTypeError is error' , ( ) => {
29- const errorType : ErrorType = { error : catchError , message : 'javascript ' , isError : true } ;
29+ const errorType : ErrorType = { error : catchError , message : 'The server is disconnected ' , isError : true } ;
3030 spyOn ( toastrServiceStub , 'error' ) ;
3131 service . checkTypeError ( errorType ) ;
3232 expect ( toastrServiceStub . error ) . toHaveBeenCalled ( ) ;
3333 } ) ;
3434
35- it ( 'checkTypeError is warning' , ( ) => {
36- const errorType : ErrorType = { error : catchError , message : 'javascript' , isError : false } ;
35+ it ( 'checkTypeError is warning with message' , ( ) => {
36+ const errorType : ErrorType = { error : catchError , message : 'The server is disconnected' , isError : false } ;
37+ spyOn ( toastrServiceStub , 'warning' ) ;
38+ service . checkTypeError ( errorType ) ;
39+ expect ( toastrServiceStub . warning ) . toHaveBeenCalled ( ) ;
40+ } ) ;
41+
42+ it ( 'checkTypeError is warning without message' , ( ) => {
43+ const errorType : ErrorType = { error : catchError , isError : false } ;
3744 spyOn ( toastrServiceStub , 'warning' ) ;
3845 service . checkTypeError ( errorType ) ;
3946 expect ( toastrServiceStub . warning ) . toHaveBeenCalled ( ) ;
0 commit comments