Skip to content

Commit

Permalink
Minor code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytro-ch authored Dec 11, 2019
1 parent f4373bc commit 26e5774
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions dev/tests/js/jasmine/tests/lib/mage/browser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ define([
var obj;

beforeEach(function () {

/**
* Dummy constructor to use for instantiation
* @constructor
Expand All @@ -27,14 +26,14 @@ define([
describe('"openDialog" method', function () {
it('Opens dialog with provided targetElementId', function () {
var options = {
'targetElementId': 1
};
'targetElementId': 1
};

spyOn($, 'ajax').and.callFake(
function () {
function () {
return {
/**
* Succes result of ajax request
* Success result of ajax request
*/
done: function () {
obj.targetElementId = 1;
Expand All @@ -44,22 +43,21 @@ define([
obj.openDialog('instance/url', 100, 100, 'title', options);
obj.openDialog('instance/url', 100, 100, 'title', options);
expect($.ajax.calls.count()).toBe(1);

});

it('Opens dialog with provided url param', function () {
spyOn($, 'ajax').and.callFake(
function () {
return {
/**
* Succes result of ajax request
*/
done: function () {
obj.targetElementId = 'instance/url';
obj.modalLoaded = true;
}
};
});
function () {
return {
/**
* Success result of ajax request
*/
done: function () {
obj.targetElementId = 'instance/url';
obj.modalLoaded = true;
}
};
});
obj.openDialog('instance/url', 100, 100, 'title', undefined);
obj.openDialog('instance/url', 100, 100, 'title', undefined);
expect($.ajax.calls.count()).toBe(1);
Expand Down

0 comments on commit 26e5774

Please sign in to comment.