Skip to content

Commit

Permalink
Covered jasmine test.
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Echo committed Mar 18, 2020
1 parent 0f6a15c commit 4338e4c
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,21 @@ define([
'use strict';

describe('ui/js/modal/confirm', function () {
var element = $('<div>some element</div>'),

var widget,
element,
confirm;

beforeEach(function () {
element = $('<div id="element">some element</div>');
confirm = element.confirm({});
widget = element.confirm({}).data('mage-confirm');
});

afterEach(function () {
$('element').remove();

});

it('Check for modal definition', function () {
expect(confirm).toBeDefined();
Expand All @@ -23,5 +36,11 @@ define([
it('Integration: modal created on page', function () {
expect(confirm.length).toEqual(1);
});
it('Check confirm class button', function () {
var expectedClassResult = 'action primary action-primary action-accept',
expectedClass = widget.options.buttons[1].class;

expect($(expectedClass).selector).toContain(expectedClassResult);
});
});
});

0 comments on commit 4338e4c

Please sign in to comment.