Skip to content

Commit

Permalink
AC-2558: Fixed code grunt-contrib-jasmine
Browse files Browse the repository at this point in the history
  • Loading branch information
anzin authored and Andrii Beziazychnyi committed May 6, 2022
1 parent 96faea7 commit 1dab24c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ define(
*/
execute: function () {
fullScreenLoader.startLoader();
this.reloadPage();
this.redirectToSuccessPage();
},

/**
* Method to reload page
* Redirect to success page.
*/
reloadPage: function () {
redirectToSuccessPage: function () {
window.location.replace(url.build(this.redirectUrl));
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ define([
messageContainer = messageContainer || globalMessageList;

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

/**
* Method to reload page
* Method to redirect by requested URL.
*/
reloadPage: function (redirectUrl) {
redirectTo: function (redirectUrl) {
window.location.replace(redirectUrl);
}
};
Expand Down
3 changes: 1 addition & 2 deletions dev/tests/js/jasmine/spec_runner/tasks/jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ function init(config) {
helpers: specs,
sandboxArgs: {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
defaultViewport: {width: 400, height: 400, hasTouch: true},
slowMo: 10000
defaultViewport: {width: 400, height: 400, hasTouch: true}
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define([
});

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

expect(FullScreenLoader.startLoader).toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ define([
it('check on failed status', function () {
var messageContainer = jasmine.createSpyObj('globalMessageList', ['addErrorMessage']);

spyOn(model, 'reloadPage').and.callFake(function () {});
spyOn(model, 'redirectTo').and.callFake(function () {});
model.process({
status: 401,
responseText: ''
Expand Down
2 changes: 1 addition & 1 deletion package.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"homepage": "https://magento.com/",
"devDependencies": {
"glob": "~7.2.0",
"grunt": "~1.4.1",
"grunt": "~1.5.0",
"grunt-banner": "~0.6.0",
"grunt-continue": "~0.1.0",
"grunt-contrib-clean": "~2.0.0",
Expand Down

0 comments on commit 1dab24c

Please sign in to comment.