');
@@ -307,6 +345,8 @@ describe('jqLite', function(){
expect(root.children()).toJqEqual([div, span]);
});
});
+
+
describe('append', function(){
it('should append', function(){
var root = jqLite('
');
@@ -324,6 +364,8 @@ describe('jqLite', function(){
expect(root.children().length).toBe(0);
});
});
+
+
describe('remove', function(){
it('should remove', function(){
var root = jqLite('
abc
');
@@ -332,6 +374,8 @@ describe('jqLite', function(){
expect(root.html()).toEqual('');
});
});
+
+
describe('after', function(){
it('should after', function(){
var root = jqLite('
');
@@ -339,6 +383,8 @@ describe('jqLite', function(){
expect(span.after('
')).toEqual(span);
expect(root.html().toLowerCase()).toEqual('
');
});
+
+
it('should allow taking text', function(){
var root = jqLite('
');
var span = root.find('span');
@@ -346,6 +392,8 @@ describe('jqLite', function(){
expect(root.html().toLowerCase()).toEqual('
abc');
});
});
+
+
describe('parent', function(){
it('should return parent or an empty set when no parent', function(){
var parent = jqLite('
'),
@@ -357,11 +405,15 @@ describe('jqLite', function(){
expect(child.parent().length).toBe(1);
expect(child.parent()[0]).toBe(parent[0]);
});
+
+
it('should return empty set when no parent', function(){
var element = jqLite('
abc
');
expect(element.parent()).toBeTruthy();
expect(element.parent().length).toEqual(0);
});
+
+
it('should return empty jqLite object when parent is a document fragment', function() {
//this is quite unfortunate but jQuery 1.5.1 behaves this way
var fragment = document.createDocumentFragment(),
@@ -372,6 +424,8 @@ describe('jqLite', function(){
expect(child.parent().length).toBe(0);
});
});
+
+
describe('next', function(){
it('should return next sibling', function(){
var element = jqLite('
bi
');
@@ -380,6 +434,8 @@ describe('jqLite', function(){
expect(b.next()).toJqEqual([i]);
});
});
+
+
describe('find', function(){
it('should find child by name', function(){
var root = jqLite('
');
@@ -388,5 +444,4 @@ describe('jqLite', function(){
expect(innerDiv.html()).toEqual('text');
});
});
-
});
--
cgit v1.2.3