Fix JSCS errors

This commit is contained in:
Rowan Manning
2016-04-25 21:26:59 +01:00
parent 90328cfa39
commit ea48d6a6fd
31 changed files with 366 additions and 364 deletions

View File

@@ -17,9 +17,9 @@
var assert = require('proclaim');
describe('GET /<task-id>/<result-id>.csv', function () {
describe('GET /<task-id>/<result-id>.csv', function() {
beforeEach(function (done) {
beforeEach(function(done) {
var req = {
method: 'GET',
endpoint: '/abc000000000000000000001/def000000000000000000001.csv',
@@ -28,19 +28,19 @@ describe('GET /<task-id>/<result-id>.csv', function () {
this.navigate(req, done);
});
it('should send a 200 status', function () {
it('should send a 200 status', function() {
assert.strictEqual(this.last.status, 200);
});
it('should output CSV results', function () {
it('should output CSV results', function() {
assert.match(this.last.body, /^"code","message","type"/);
});
});
describe('GET /<task-id>/<result-id>.json', function () {
describe('GET /<task-id>/<result-id>.json', function() {
beforeEach(function (done) {
beforeEach(function(done) {
var req = {
method: 'GET',
endpoint: '/abc000000000000000000001/def000000000000000000001.json',
@@ -49,11 +49,11 @@ describe('GET /<task-id>/<result-id>.json', function () {
this.navigate(req, done);
});
it('should send a 200 status', function () {
it('should send a 200 status', function() {
assert.strictEqual(this.last.status, 200);
});
it('should output JSON results', function () {
it('should output JSON results', function() {
var json = this.last.body;
assert.strictEqual(json.task.name, 'NPG Home');
assert.strictEqual(json.task.url, 'nature.com');

View File

@@ -17,9 +17,9 @@
var assert = require('proclaim');
describe('GET /<task-id>/<result-id>', function () {
describe('GET /<task-id>/<result-id>', function() {
beforeEach(function (done) {
beforeEach(function(done) {
var req = {
method: 'GET',
endpoint: '/abc000000000000000000001/def000000000000000000001'
@@ -27,39 +27,39 @@ describe('GET /<task-id>/<result-id>', function () {
this.navigate(req, done);
});
it('should send a 200 status', function () {
it('should send a 200 status', function() {
assert.strictEqual(this.last.status, 200);
});
it('should display a "Download CSV" button', function () {
it('should display a "Download CSV" button', function() {
var elem = this.last.dom.querySelectorAll('[data-test=download-csv]');
assert.strictEqual(elem.length, 1);
assert.strictEqual(elem[0].getAttribute('href'), '/abc000000000000000000001/def000000000000000000001.csv');
});
it('should display a "Download JSON" button', function () {
it('should display a "Download JSON" button', function() {
var elem = this.last.dom.querySelectorAll('[data-test=download-json]');
assert.strictEqual(elem.length, 1);
assert.strictEqual(elem[0].getAttribute('href'), '/abc000000000000000000001/def000000000000000000001.json');
});
it('should display a link back to the task', function () {
it('should display a link back to the task', function() {
assert.isDefined(this.last.dom.querySelectorAll('[href="/abc000000000000000000001"]')[0]);
});
it('should display errors', function () {
it('should display errors', function() {
var elem = this.last.dom.querySelectorAll('[data-test=task-errors]')[0];
assert.isDefined(elem);
assert.match(elem.textContent, /errors \( 1 \)/i);
});
it('should display warnings', function () {
it('should display warnings', function() {
var elem = this.last.dom.querySelectorAll('[data-test=task-warnings]')[0];
assert.isDefined(elem);
assert.match(elem.textContent, /warnings \( 2 \)/i);
});
it('should display notices', function () {
it('should display notices', function() {
var elem = this.last.dom.querySelectorAll('[data-test=task-notices]')[0];
assert.isDefined(elem);
assert.match(elem.textContent, /notices \( 3 \)/i);