QUnit.module('views');

QUnit.test('ok.View()', function (assert) {
	var view = new ok.View();
	assert.ok(view instanceof ok.View, 'Can create views');
	assert.deepEqual(view.classNames, ['ok-view'], 'Views have "ok-view" class by default');
	assert.deepEqual(ok.toArray(view.el.classList), ['ok-view'], 'Classes are applied to view element');
	assert.equal(view.tagName, 'div', 'Views are divs by default');
	assert.equal(view.el.tagName.toLowerCase(), 'div', 'Views elements are divs by default');
	var custom = new ok.View({
		tagName: 'p',
		classNames: 'custom-paragraph'
	});
	assert.equal(custom.tagName, 'p', 'Tag name property is set on init');
	assert.equal(custom.el.tagName.toLowerCase(), 'p', 'Can make views a tag other than div');
	assert.deepEqual(custom.classNames, ['ok-view', 'custom-paragraph'], 'Classes can be set on views');
	assert.deepEqual(ok.toArray(custom.el.classList), ['ok-view', 'custom-paragraph'], 'Classes can be set on view elements');
});

QUnit.test('ok.View#isStarted', function (assert) {
	var view = new ok.View();
	assert.equal(view.isStarted, false, 'Views are not started by default');
	view.start();
	assert.equal(view.isStarted, true, 'View can be started');
	view.stop();
	assert.equal(view.isStarted, false, 'View can be stopped');
});

@@ -1269,16 +1269,339 @@
  stopped');%0A%7D);%0A
+%0AQUnit.test('ok.View#setElement()', function (assert) %7B%0A%09var a = document.createElement('h1');%0A%09var b = document.createElement('h2');%0A%09var view = new ok.View(%7B%0A%09%09el: a%0A%09%7D);%0A%09assert.equal(view.el, a, 'Views can be initialized with an element');%0A%09view.setElement(b);%0A%09assert.equal(view.el, b, 'View element can be set');%0A%7D);%0A

Test view `setElement()` method