aboutsummaryrefslogtreecommitdiffstats
path: root/test/jqLiteSpec.js
diff options
context:
space:
mode:
authorIgor Minar2012-11-24 01:34:01 +0100
committerIgor Minar2012-11-26 15:45:04 +0100
commit96ed9ff59a454486c88bdf92ad9d28ab8864b85e (patch)
treeac5ffeb929d1a2f4f0d08d6f7a1f60f44c405097 /test/jqLiteSpec.js
parentb9a9f91fbf99b71cfde434b6277f4c7d2533556f (diff)
downloadangular.js-96ed9ff59a454486c88bdf92ad9d28ab8864b85e.tar.bz2
fix(jqLite): support append on document fragment
previously jquery didn't support append on this node type, now it does (since 1.8.x) so I'm adding this to jqlite as well.
Diffstat (limited to 'test/jqLiteSpec.js')
-rw-r--r--test/jqLiteSpec.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index 76a2c5a8..01f9b9ae 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -955,9 +955,14 @@ describe('jqLite', function() {
expect(root.append('text')).toEqual(root);
expect(root.html()).toEqual('text');
});
- it('should not append anything if parent node is not of type element', function() {
+ it('should append to document fragment', function() {
var root = jqLite(document.createDocumentFragment());
expect(root.append('<p>foo</p>')).toBe(root);
+ expect(root.children().length).toBe(1);
+ });
+ it('should not append anything if parent node is not of type element or docfrag', function() {
+ var root = jqLite('<p>some text node</p>').contents();
+ expect(root.append('<p>foo</p>')).toBe(root);
expect(root.children().length).toBe(0);
});
});