
/**
 * Test dependencies.
 */

var Element = require('../lib/element');
var assert = require('assert');


describe("create", function() {

	it('should create a div', function() {
		var div = new Element('div');
		assert.equal(div.render(), '<div></div>');
	});

	it('should create any element', function() {
		var btn = new Element('button');
		assert.equal(btn.render(), '<button></button>');
	});

	// it('should set innerHTML', function() {
	// 	var btn = new Element('button');
	// 	btn.innerHTML = 'something';
	// 	assert.equal(btn.render(), '<button>something</button>');
	// });

});


describe('append', function() {

	it('should append an other element', function() {
		var link = new Element('a');
		var btn = new Element('button');
		link.appendChild(btn);
		assert.equal(link.render(), '<a><button></button></a>');
	});

	// we should test children as well
	
	it('should append multiple element', function() {
		var link = new Element('a');
		var first = new Element('span');
		var second = new Element('span');
		link.appendChild(first);
		link.appendChild(second);
		assert.equal(link.render(), '<a><span></span><span></span></a>');
	});
});

@@ -935,33 +935,35 @@
  = new Element('
-a
+div
 ');%0A%09%09var first 
@@ -1112,22 +1112,299 @@
 , '%3C
-a%3E%3Cspan%3E%3C/span
+div%3E%3Cspan%3E%3C/span%3E%3Cspan%3E%3C/span%3E%3C/div%3E');%0A%09%7D);%0A%0A%09it('should append nested elements', function() %7B%0A%09%09var link = new Element('div');%0A%09%09var first = new Element('a');%0A%09%09var second = new Element('span');%0A%09%09link.appendChild(first);%0A%09%09first.appendChild(second);%0A%09%09assert.equal(link.render(), '%3Cdiv%3E%3Ca
 %3E%3Csp
@@ -1413,24 +1413,30 @@
 %3E%3C/span%3E%3C/a%3E
+%3C/div%3E
 ');%0A%09%7D);%0A%7D);

append nested elements