aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/jqLiteSpec.js13
-rw-r--r--test/testabilityPatch.js2
2 files changed, 8 insertions, 7 deletions
diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js
index a5e7b34e..3755a3ea 100644
--- a/test/jqLiteSpec.js
+++ b/test/jqLiteSpec.js
@@ -924,8 +924,8 @@ describe('jqLite', function() {
describe('children', function() {
- it('should select non-text children', function() {
- var root = jqLite('<div>').html('before-<div></div>after-<span></span>');
+ it('should only select element nodes', function() {
+ var root = jqLite('<div><!-- some comment -->before-<div></div>after-<span></span>');
var div = root.find('div');
var span = root.find('span');
expect(root.children()).toJqEqual([div, span]);
@@ -934,11 +934,12 @@ describe('jqLite', function() {
describe('contents', function() {
- it('should select all children nodes', function() {
- var root = jqLite('<div>').html('before-<div></div>after-<span></span>');
+ it('should select all types child nodes', function() {
+ var root = jqLite('<div><!-- some comment -->before-<div></div>after-<span></span></div>');
var contents = root.contents();
- expect(contents.length).toEqual(4);
- expect(jqLite(contents[0]).text()).toEqual('before-');
+ expect(contents.length).toEqual(5);
+ expect(contents[0].data).toEqual(' some comment ');
+ expect(contents[1].data).toEqual('before-');
});
});
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index ac22c72c..d55ff015 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -78,7 +78,7 @@ function dealoc(obj) {
function cleanup(element) {
element.unbind().removeData();
- for ( var i = 0, children = element.children() || []; i < children.length; i++) {
+ for ( var i = 0, children = element.contents() || []; i < children.length; i++) {
cleanup(jqLite(children[i]));
}
}