2015-04-26 08:04:49 +00:00
|
|
|
var assert = require('chai').assert,
|
2015-04-26 07:16:26 +00:00
|
|
|
utils = require('./utils');
|
|
|
|
|
|
|
|
var $ = utils.getSelectorObject();
|
|
|
|
|
|
|
|
describe('Main module', function () {
|
2015-04-26 08:04:49 +00:00
|
|
|
it('should contain a non-duplicate link for all title', function () {
|
|
|
|
var links = [];
|
2015-04-26 07:16:26 +00:00
|
|
|
|
2015-04-26 08:04:49 +00:00
|
|
|
$('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;
|
|
|
|
});
|
2015-04-26 07:16:26 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should be sorted alphabetically', function () {
|
2015-04-26 08:04:49 +00:00
|
|
|
$('ul').each(function () {
|
|
|
|
utils.testList(assert, $, $(this));
|
|
|
|
})
|
2015-04-26 07:16:26 +00:00
|
|
|
});
|
|
|
|
})
|