Skip to content

Commit

Permalink
Fixing a broken multi-shipping test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Harvell committed Sep 10, 2020
1 parent 5de71f6 commit fd4a2c7
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ define([
var addNewAddressBtn,
addressflag,
canContinueBtn,
canContinueFlag;
canContinueFlag,
originalGetJSON;

beforeEach(function () {
originalGetJSON = $.getJSON;
addNewAddressBtn = $('<button type="button" data-role="add-new-address"/>');
addressflag = $('<input type="hidden" value="0" id="add_new_address_flag"/>');
canContinueBtn = $('<button type="submit" data-role="can-continue" data-flag="1"/>');
Expand All @@ -79,13 +81,20 @@ define([
.append(addressflag)
.append(canContinueBtn)
.append(canContinueFlag);

$.getJSON = jasmine.createSpy().and.callFake(function () {
var deferred = $.Deferred();

return deferred.promise();
});
});

afterEach(function () {
addNewAddressBtn.remove();
addressflag.remove();
canContinueBtn.remove();
canContinueFlag.remove();
$.getJSON = originalGetJSON;
});

it('Check add new address event', function () {
Expand Down

0 comments on commit fd4a2c7

Please sign in to comment.