Skip to content

Commit 1f86c12

Browse files
author
OlgaVasyltsun
committed
MC-17755: Message isn't displayed on the error after connection reset and placing order
1 parent c7c66ad commit 1f86c12

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/error-processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ define([
2929
try {
3030
error = JSON.parse(response.responseText);
3131
} catch (exception) {
32-
error = $t('Something went wrong with your request. Please try again later.');
32+
error = {message: $t('Something went wrong with your request. Please try again later.')};
3333
}
3434
messageContainer.addErrorMessage(error);
3535
}

dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/error-processor.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@ define([
4646
});
4747

4848
it('check on success response with invalid response data', function () {
49-
var messageContainer = jasmine.createSpyObj('globalMessageList', ['addErrorMessage']);
49+
var messageContainer = jasmine.createSpyObj('globalMessageList', ['addErrorMessage']),
50+
messageObject = {
51+
message: 'Something went wrong with your request. Please try again later.'
52+
};
5053

5154
model.process({
5255
status: 200,
5356
responseText: ''
5457
}, messageContainer);
5558
expect(messageContainer.addErrorMessage)
56-
.toHaveBeenCalledWith('Something went wrong with your request. Please try again later.');
59+
.toHaveBeenCalledWith(messageObject);
5760
});
5861

5962
it('check on failed status', function () {

0 commit comments

Comments
 (0)