aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/compilerSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2012-02-03 16:20:24 -0800
committerMisko Hevery2012-02-21 22:46:00 -0800
commit4a051efb89cf33e30d56f1227d1f6084ead4cd42 (patch)
treefd65bc139f121ebc124f83dc63c0ceab4d28e5f2 /test/service/compilerSpec.js
parent1752c8c44a7058e974ef208e583683eac8817789 (diff)
downloadangular.js-4a051efb89cf33e30d56f1227d1f6084ead4cd42.tar.bz2
feat($compile): support compiling text nodes by wrapping them in <span>
Diffstat (limited to 'test/service/compilerSpec.js')
-rw-r--r--test/service/compilerSpec.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/service/compilerSpec.js b/test/service/compilerSpec.js
index 8d91ed5d..02cdcefe 100644
--- a/test/service/compilerSpec.js
+++ b/test/service/compilerSpec.js
@@ -96,6 +96,15 @@ describe('$compile', function() {
describe('compile phase', function() {
+ it('should wrap root text nodes in spans', inject(function($compile, $rootScope) {
+ element = jqLite('<div>A&lt;a&gt;B&lt;/a&gt;C</div>');
+ var text = element.contents();
+ expect(text[0].nodeName).toEqual('#text');
+ text = $compile(text)($rootScope);
+ expect(lowercase(text[0].nodeName)).toEqual('span');
+ expect(element.find('span').text()).toEqual('A<a>B</a>C');
+ }));
+
describe('multiple directives per element', function() {
it('should allow multiple directives per element', inject(function($compile, $rootScope, log){
element = $compile(