mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
Build a basic framework for functional testing
This commit is contained in:
31
test/functional/index.js
Normal file
31
test/functional/index.js
Normal 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');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user