Skip to content

Commit

Permalink
update like_spec.js (#11524)
Browse files Browse the repository at this point in the history
* update like_spec.js

The code was in var an es5 way of declaring a variable changed it to const

* Update like_spec.js

The code was in var an es5 way of declaring a variable changed it to const

* Update like_spec.js

The code was in var an es5 way of declaring a variable changed it to let

* Update like_spec.js

fix: modified

* Update like_spec.js

* Update like_spec.js
  • Loading branch information
ijayhub authored Oct 25, 2022
1 parent 3855d15 commit affe0fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/javascripts/like_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ describe("Like Button", function () {
ajaxStub = sinon.stub($, 'ajax', function (object) {
response = object.url === '/likes/node/1/create' ? '4' : 'none'

var d = $.Deferred();
const d = $.Deferred();
response === '4' ? d.resolve(response) : d.reject(response);
return d.promise();

});

$("#like-button-1").trigger("click");

expect(ajaxStub).to.have.been.called;
Expand All @@ -44,7 +44,7 @@ describe("Like Button", function () {
// console.log('Failed to fake response to:', object.url);
// }

var d = $.Deferred();
const d = $.Deferred();
response === '4' ? d.resolve(response) : d.reject(response);
return d.promise();

Expand All @@ -65,7 +65,7 @@ describe("Like Button", function () {
ajaxStub = sinon.stub($, 'ajax', function (object) {
response = object.url === '/likes/node/1/delete' ? '4' : 'none'

var d = $.Deferred();
const d = $.Deferred();
response === '4' ? d.resolve(response) : d.reject(response);
return d.promise();

Expand Down

0 comments on commit affe0fc

Please sign in to comment.