aboutsummaryrefslogtreecommitdiffstats
path: root/test/jqLiteSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2013-05-24 12:41:38 -0700
committerMisko Hevery2013-05-28 22:28:32 -0700
commite46100f7097d9a8f174bdb9e15d4c6098395c3f2 (patch)
tree781564141fc9cf580886201d97f7d45064218d82 /test/jqLiteSpec.js
parentb8ea7f6aba2e675b85826b0bee1f21ddd7b866a5 (diff)
downloadangular.js-e46100f7097d9a8f174bdb9e15d4c6098395c3f2.tar.bz2
feat($compile): support multi-element directive
By appending directive-start and directive-end to a directive it is now possible to have the directive act on a group of elements. It is now possible to iterate over multiple elements like so: <table> <tr ng-repeat-start="item in list">I get repeated</tr> <tr ng-repeat-end>I also get repeated</tr> </table>
Diffstat (limited to 'test/jqLiteSpec.js')
-rw-r--r--test/jqLiteSpec.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index 1ebe6ad4..70c18d35 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -56,6 +56,9 @@ describe('jqLite', function() {
it('should allow construction with html', function() {
var nodes = jqLite('<div>1</div><span>2</span>');
+ expect(nodes[0].parentNode).toBeDefined();
+ expect(nodes[0].parentNode.nodeType).toBe(11); /** Document Fragment **/;
+ expect(nodes[0].parentNode).toBe(nodes[1].parentNode);
expect(nodes.length).toEqual(2);
expect(nodes[0].innerHTML).toEqual('1');
expect(nodes[1].innerHTML).toEqual('2');
@@ -644,12 +647,13 @@ describe('jqLite', function() {
it('should read/write value', function() {
- var element = jqLite('<div>abc</div>');
- expect(element.length).toEqual(1);
- expect(element[0].innerHTML).toEqual('abc');
+ var element = jqLite('<div>ab</div><span>c</span>');
+ expect(element.length).toEqual(2);
+ expect(element[0].innerHTML).toEqual('ab');
+ expect(element[1].innerHTML).toEqual('c');
expect(element.text()).toEqual('abc');
expect(element.text('xyz') == element).toBeTruthy();
- expect(element.text()).toEqual('xyz');
+ expect(element.text()).toEqual('xyzxyz');
});
});