awesome-ctf/tests/test.js
2015-04-26 13:34:49 +05:30

29 lines
No EOL
645 B
JavaScript

var assert = require('chai').assert,
utils = require('./utils');
var $ = utils.getSelectorObject();
describe('Main module', function () {
it('should contain a non-duplicate link for all title', function () {
var links = [];
$('a').each(function (k) {
var href = $(this).attr('href');
assert.isDefined(href, 'Expected href for ' + $(this).html());
if (links[href]) {
console.log(href);
assert.ok(false, 'Duplicate link for ' + $(this).html());
}
links[href] = true;
});
});
it('should be sorted alphabetically', function () {
$('ul').each(function () {
utils.testList(assert, $, $(this));
})
});
})