Build a basic framework for functional testing

This commit is contained in:
Rowan Manning
2013-11-20 16:14:21 +00:00
parent 9d72e50b4e
commit 623a52e112
9 changed files with 143 additions and 5 deletions

31
test/functional/index.js Normal file
View File

@@ -0,0 +1,31 @@
/* global beforeEach, describe, it */
/* jshint maxlen: 200, maxstatements: 20 */
'use strict';
var assert = require('proclaim');
describe('GET /', function () {
describe('with no query', function () {
beforeEach(function (done) {
var req = {
method: 'GET',
endpoint: '/'
};
this.navigate(req, done);
});
it('should send a 200 status', function () {
assert.strictEqual(this.last.status, 200);
});
it('should have an "Add new URL" button', function () {
var elem = this.last.dom.querySelectorAll('[data-test=add-task]');
assert.strictEqual(elem.length, 1);
assert.strictEqual(elem[0].getAttribute('href'), '/new');
});
});
});