UNPKG

axe-core

Version:

Accessibility engine for automated Web UI testing

25 lines (21 loc) 605 B
import React from 'react'; import axe from 'axe-core'; import { mountToDoc } from './test-helpers'; import Link from './Link'; test('Link has no aXe violations', (done) => { const linkComponent = mountToDoc( <Link page="http://www.axe-core.org">aXe website</Link> ); const linkNode = linkComponent.getDOMNode(); const config = { "rules": { "color-contrast": { enabled: false }, "link-in-text-block": { enabled: false } } } axe.run(linkNode, config, (err, { violations }) => { expect(err).toBe(null); expect(violations).toHaveLength(0); done(); }); });