File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -61,14 +61,20 @@ define([
61
61
62
62
it ( 'check on failed status' , function ( ) {
63
63
var messageContainer = jasmine . createSpyObj ( 'globalMessageList' , [ 'addErrorMessage' ] ) ;
64
-
64
+ let messageObject = {
65
+ message : 'You are not authorized to access this resource.'
66
+ } ;
65
67
spyOn ( model , 'redirectTo' ) . and . callFake ( function ( ) { } ) ;
66
68
model . process ( {
67
69
status : 401 ,
68
70
responseText : ''
69
71
} , messageContainer ) ;
70
- expect ( mocks [ 'mage/url' ] . build )
71
- . toHaveBeenCalled ( ) ;
72
+ expect ( messageContainer . addErrorMessage )
73
+ . toHaveBeenCalledWith ( messageObject ) ;
74
+ setTimeout ( function ( ) {
75
+ expect ( mocks [ 'mage/url' ] . build ) . toHaveBeenCalled ( ) ;
76
+ done ( ) ;
77
+ } , 2000 ) ;
72
78
} ) ;
73
79
} ) ;
74
80
} ) ;
You can’t perform that action at this time.
0 commit comments