Skip to content

Commit 1dab24c

Browse files
anzinandrewbess
authored andcommitted
AC-2558: Fixed code grunt-contrib-jasmine
1 parent 96faea7 commit 1dab24c

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

app/code/Magento/Checkout/view/frontend/web/js/action/redirect-on-success.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ define(
2222
*/
2323
execute: function () {
2424
fullScreenLoader.startLoader();
25-
this.reloadPage();
25+
this.redirectToSuccessPage();
2626
},
2727

2828
/**
29-
* Method to reload page
29+
* Redirect to success page.
3030
*/
31-
reloadPage: function () {
31+
redirectToSuccessPage: function () {
3232
window.location.replace(url.build(this.redirectUrl));
3333
}
3434
};

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ define([
2424
messageContainer = messageContainer || globalMessageList;
2525

2626
if (response.status == 401) { //eslint-disable-line eqeqeq
27-
this.reloadPage(url.build('customer/account/login/'));
27+
this.redirectTo(url.build('customer/account/login/'));
2828
} else {
2929
try {
3030
error = JSON.parse(response.responseText);
@@ -38,9 +38,9 @@ define([
3838
},
3939

4040
/**
41-
* Method to reload page
41+
* Method to redirect by requested URL.
4242
*/
43-
reloadPage: function (redirectUrl) {
43+
redirectTo: function (redirectUrl) {
4444
window.location.replace(redirectUrl);
4545
}
4646
};

dev/tests/js/jasmine/spec_runner/tasks/jasmine.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ function init(config) {
7070
helpers: specs,
7171
sandboxArgs: {
7272
args: ['--no-sandbox', '--disable-setuid-sandbox'],
73-
defaultViewport: {width: 400, height: 400, hasTouch: true},
74-
slowMo: 10000
73+
defaultViewport: {width: 400, height: 400, hasTouch: true}
7574
}
7675
}
7776
};

dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/action/redirect-on-success.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ define([
3535
});
3636

3737
it('Checks if loader is called before redirect to success page.', function () {
38-
spyOn(RedirectOnSuccess, 'reloadPage').and.callFake(function () {});
38+
spyOn(RedirectOnSuccess, 'redirectToSuccessPage').and.callFake(function () {});
3939
RedirectOnSuccess.execute();
4040

4141
expect(FullScreenLoader.startLoader).toHaveBeenCalled();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ define([
6262
it('check on failed status', function () {
6363
var messageContainer = jasmine.createSpyObj('globalMessageList', ['addErrorMessage']);
6464

65-
spyOn(model, 'reloadPage').and.callFake(function () {});
65+
spyOn(model, 'redirectTo').and.callFake(function () {});
6666
model.process({
6767
status: 401,
6868
responseText: ''

package.json.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"homepage": "https://magento.com/",
1111
"devDependencies": {
1212
"glob": "~7.2.0",
13-
"grunt": "~1.4.1",
13+
"grunt": "~1.5.0",
1414
"grunt-banner": "~0.6.0",
1515
"grunt-continue": "~0.1.0",
1616
"grunt-contrib-clean": "~2.0.0",

0 commit comments

Comments
 (0)