UNPKG

axe-core

Version:

Accessibility engine for automated Web UI testing

52 lines (43 loc) 1.32 kB
describe('landmark-no-more-than-one-contentinfo test failure', function () { 'use strict'; var results; before(function (done) { function start() { axe.run({ runOnly: { type: 'rule', values: ['landmark-no-duplicate-contentinfo'] } }, function (err, r) { assert.isNull(err); results = r; done(); }); } if (document.readyState !== 'complete') { window.addEventListener('load', start); } else { start(); } }); describe('violations', function () { it('should find 3', function () { assert.lengthOf(results.violations[0].nodes, 3); }); it('should find #fail1', function () { assert.deepEqual(results.violations[0].nodes[0].target, ['#fail1']); }); it('should find #frame1, #fail2', function () { assert.deepEqual(results.violations[0].nodes[1].target, ['#frame1', '#fail2']); }); it('should find #frame1, #frame2, #fail3', function () { assert.deepEqual(results.violations[0].nodes[2].target, ['#frame1', '#frame2', '#fail3']); }); }); describe('passes', function () { it('should find 0', function () { assert.lengthOf(results.passes, 0); }); }); it('should find 0 inapplicable', function () { assert.lengthOf(results.inapplicable, 0); }); it('should find 0 incomplete', function () { assert.lengthOf(results.incomplete, 0); }); });