forked from external-repos/pa11y-dashboard
Support Node.js 0.10–6 (#132)
* Update dependencies * Switch from jsdom to cheerio * Update the supported Node.js versions * Recompile the client-side CSS and JS
This commit is contained in:

committed by
Andrew Mee

parent
6bfb4f72d9
commit
ae6208d87e
@@ -44,7 +44,8 @@ describe('GET /<task-id>/<result-id>.json', function() {
|
||||
var req = {
|
||||
method: 'GET',
|
||||
endpoint: '/abc000000000000000000001/def000000000000000000001.json',
|
||||
nonDom: true
|
||||
nonDom: true,
|
||||
json: true
|
||||
};
|
||||
this.navigate(req, done);
|
||||
});
|
||||
|
@@ -32,37 +32,37 @@ describe('GET /<task-id>/<result-id>', function() {
|
||||
});
|
||||
|
||||
it('should display a "Download CSV" button', function() {
|
||||
var elem = this.last.dom.querySelectorAll('[data-test=download-csv]');
|
||||
var elem = this.last.dom('[data-test=download-csv]');
|
||||
assert.strictEqual(elem.length, 1);
|
||||
assert.strictEqual(elem[0].getAttribute('href'), '/abc000000000000000000001/def000000000000000000001.csv');
|
||||
assert.strictEqual(elem.eq(0).attr('href'), '/abc000000000000000000001/def000000000000000000001.csv');
|
||||
});
|
||||
|
||||
it('should display a "Download JSON" button', function() {
|
||||
var elem = this.last.dom.querySelectorAll('[data-test=download-json]');
|
||||
var elem = this.last.dom('[data-test=download-json]');
|
||||
assert.strictEqual(elem.length, 1);
|
||||
assert.strictEqual(elem[0].getAttribute('href'), '/abc000000000000000000001/def000000000000000000001.json');
|
||||
assert.strictEqual(elem.eq(0).attr('href'), '/abc000000000000000000001/def000000000000000000001.json');
|
||||
});
|
||||
|
||||
it('should display a link back to the task', function() {
|
||||
assert.isDefined(this.last.dom.querySelectorAll('[href="/abc000000000000000000001"]')[0]);
|
||||
assert.isDefined(this.last.dom('[href="/abc000000000000000000001"]').eq(0));
|
||||
});
|
||||
|
||||
it('should display errors', function() {
|
||||
var elem = this.last.dom.querySelectorAll('[data-test=task-errors]')[0];
|
||||
var elem = this.last.dom('[data-test=task-errors]').eq(0);
|
||||
assert.isDefined(elem);
|
||||
assert.match(elem.textContent, /errors \( 1 \)/i);
|
||||
assert.match(elem.text(), /errors \( 1 \)/i);
|
||||
});
|
||||
|
||||
it('should display warnings', function() {
|
||||
var elem = this.last.dom.querySelectorAll('[data-test=task-warnings]')[0];
|
||||
var elem = this.last.dom('[data-test=task-warnings]').eq(0);
|
||||
assert.isDefined(elem);
|
||||
assert.match(elem.textContent, /warnings \( 2 \)/i);
|
||||
assert.match(elem.text(), /warnings \( 2 \)/i);
|
||||
});
|
||||
|
||||
it('should display notices', function() {
|
||||
var elem = this.last.dom.querySelectorAll('[data-test=task-notices]')[0];
|
||||
var elem = this.last.dom('[data-test=task-notices]').eq(0);
|
||||
assert.isDefined(elem);
|
||||
assert.match(elem.textContent, /notices \( 3 \)/i);
|
||||
assert.match(elem.text(), /notices \( 3 \)/i);
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user