From 2d7304c33cf608037f8d27773bf1eed13d34a7dd Mon Sep 17 00:00:00 2001 From: Olivier Louvignes Date: Sun, 12 Jul 2015 17:37:38 +0200 Subject: [PATCH] test(modal): add missing contentTemplate test --- src/modal/test/modal.spec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/modal/test/modal.spec.js b/src/modal/test/modal.spec.js index 0619d4e05..401b3c293 100644 --- a/src/modal/test/modal.spec.js +++ b/src/modal/test/modal.spec.js @@ -76,6 +76,10 @@ describe('modal', function() { 'options-template': { scope: {modal: {title: 'Title', content: 'Hello Modal!', counter: 0}, items: ['foo', 'bar', 'baz']}, element: 'click me' + }, + 'options-contentTemplate': { + scope: {modal: {title: 'Title', content: 'Hello Modal!', counter: 0}, items: ['foo', 'bar', 'baz']}, + element: 'click me' } }; @@ -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('
');