Skip to content

Commit

Permalink
ENGCOM-6517: Textarea patch 1 #26142
Browse files Browse the repository at this point in the history
  • Loading branch information
slavvka authored Feb 10, 2020
2 parents ea6b7f4 + 0d2ef6e commit a4fc1a3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1 id="modal-title-<%- data.id %>" class="modal-title"

<% if(data.subTitle){ %>
<span class="modal-subtitle"
data-role="subtitle">
data-role="subTitle">
<%= data.subTitle %>
</span>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1 id="modal-title-<%- data.id %>" class="modal-title"

<% if(data.subTitle){ %>
<span class="modal-subtitle"
data-role="subtitle">
data-role="subTitle">
<%= data.subTitle %>
</span>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,45 @@ define([
'use strict';

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

var element,
modal;

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

$(element).append('<h1 class="modal-title"' +
' data-role="title">Title</h1>' +
'<span class="modal-subtitle"' +
' data-role="subTitle"></span>');
});

afterEach(function () {
$('.modal-title').remove();
$('#element').remove();

});

it('Check for modal definition', function () {
expect(modal).toBeDefined();
});

it('Show/hide function check', function () {
expect(element.trigger('openModal')).toBe(element);
expect(element.trigger('closeModal')).toBe(element);
});

it('Integration: modal created on page', function () {
expect($(modal).length).toEqual(1);
});

it('Verify set title', function () {
var newTitle = 'New modal title';

modal.setTitle(newTitle);
expect($(modal.options.modalTitle).text()).toContain(newTitle);
expect($(modal.options.modalTitle).find(modal.options.modalSubTitle).length).toBe(1);
});
});
});

0 comments on commit a4fc1a3

Please sign in to comment.