Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
test(modal): add missing contentTemplate test
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcrea committed Jul 12, 2015
1 parent 504cd83 commit 2d7304c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/modal/test/modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ describe('modal', function() {
'options-template': {
scope: {modal: {title: 'Title', content: 'Hello Modal!', counter: 0}, items: ['foo', 'bar', 'baz']},
element: '<a title="{{modal.title}}" data-content="{{modal.content}}" data-template="custom" bs-modal>click me</a>'
},
'options-contentTemplate': {
scope: {modal: {title: 'Title', content: 'Hello Modal!', counter: 0}, items: ['foo', 'bar', 'baz']},
element: '<a title="{{modal.title}}" data-content="{{modal.content}}" data-content-template="custom" bs-modal>click me</a>'
}
};

Expand Down Expand Up @@ -585,6 +589,17 @@ describe('modal', function() {

});

describe('contentTemplate', function() {

it('should support custom contentTemplate', function() {
$templateCache.put('custom', 'baz: {{title}}');
var elm = compileDirective('options-contentTemplate');
angular.element(elm[0]).triggerHandler('click');
expect(sandboxEl.find('.modal-body').text()).toBe('baz: ' + scope.modal.title);
});

});

describe('container', function() {
it('accepts element object', function() {
var testElm = angular.element('<div></div>');
Expand Down

0 comments on commit 2d7304c

Please sign in to comment.