How to use the @instructure/ui-axe-check.default function in @instructure/ui-axe-check

To help you get started, we’ve selected a few @instructure/ui-axe-check examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instructure / instructure-ui / packages / ui-testbed / lib / enzymeWrapper.js View on Github external
ReactWrapper.prototype.getA11yViolations = function (done, options) {
  runAxeCheck(this.getDOMNode(), options).then((result) => {
    if (result instanceof Error) {
      done(result)
    } else {
      done()
    }
  }, done)
}
github instructure / instructure-ui / packages / ui-testbed / lib / chaiWrapper.js View on Github external
utils.addMethod(chai.Assertion.prototype, 'accessible', function (done, options = {}) {
      const obj = utils.flag(this, 'object')
      let element = obj
      if (typeof obj.getA11yViolations === 'function') {
        obj.getA11yViolations(done, options)
      } else if (obj instanceof Element) {
        runAxeCheck(element, options).then((result) => {
          if (result instanceof Error) {
            done(result)
          } else {
            done()
          }
        }, done)
      } else {
        done(new Error('[ui-testbed] accessibility check can only run on a single DOM Element!'))
      }
    })
  })

@instructure/ui-axe-check

A UI a11y testing library made by Instructure Inc.

MIT
Latest version published 4 days ago

Package Health Score

79 / 100
Full package analysis

Popular @instructure/ui-axe-check functions

Similar packages