From 791994a94023481add7dde8ad6e447aab7f6f120 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Wed, 28 Apr 2021 21:48:33 +0200 Subject: [PATCH 1/2] fix(getStandards): Read standards from utils --- lib/core/utils/get-standards.js | 6 ++++++ lib/core/utils/index.js | 1 + test/core/utils/get-standards.js | 11 +++++++++++ 3 files changed, 18 insertions(+) create mode 100644 lib/core/utils/get-standards.js create mode 100644 test/core/utils/get-standards.js diff --git a/lib/core/utils/get-standards.js b/lib/core/utils/get-standards.js new file mode 100644 index 0000000000..508fc60cd4 --- /dev/null +++ b/lib/core/utils/get-standards.js @@ -0,0 +1,6 @@ +import standards from '../../standards/index' +import clone from './clone' + +export default function getStandards() { + return clone(standards); +} diff --git a/lib/core/utils/index.js b/lib/core/utils/index.js index efb1ae436a..d15cb8c763 100644 --- a/lib/core/utils/index.js +++ b/lib/core/utils/index.js @@ -38,6 +38,7 @@ export { default as getScrollState } from './get-scroll-state'; export { default as getScroll } from './get-scroll'; export { default as getShadowSelector } from './get-shadow-selector'; export { default as getSelector, getSelectorData } from './get-selector'; +export { default as getStandards } from './get-standards'; export { default as getStyleSheetFactory } from './get-stylesheet-factory'; export { default as getXpath } from './get-xpath'; export { default as getAncestry } from './get-ancestry'; diff --git a/test/core/utils/get-standards.js b/test/core/utils/get-standards.js new file mode 100644 index 0000000000..3a93db63c5 --- /dev/null +++ b/test/core/utils/get-standards.js @@ -0,0 +1,11 @@ +describe('axe.utils.getStandards', function () { + it('returns the standards object', function () { + var standards = axe.utils.getStandards(); + assert.hasAnyKeys(standards, [ + 'ariaAttrs', + 'ariaRoles', + 'htmlElms', + 'cssColors' + ]); + }); +}); From 8a5d9190edb20702d95cbc4cb0f212d165d2bad6 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Fri, 30 Apr 2021 12:25:19 +0200 Subject: [PATCH 2/2] Update lib/core/utils/get-standards.js Co-authored-by: Steven Lambert <2433219+straker@users.noreply.github.com> --- lib/core/utils/get-standards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/utils/get-standards.js b/lib/core/utils/get-standards.js index 508fc60cd4..d902832f87 100644 --- a/lib/core/utils/get-standards.js +++ b/lib/core/utils/get-standards.js @@ -1,4 +1,4 @@ -import standards from '../../standards/index' +import standards from '../../standards' import clone from './clone' export default function getStandards() {