From 25867b0f0d8ecd364d233aa697dee772c28d708d Mon Sep 17 00:00:00 2001 From: Akash Gupta Date: Thu, 4 Feb 2021 06:57:37 +0530 Subject: [PATCH 1/8] updated dependency Signed-off-by: Akash Gupta --- package.json | 2 +- scripts/a11y-testing.js | 2 +- src/components/popover/popover.tsx | 1 + yarn.lock | 16 ++++++++-------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 2a86b0c4bbe4..b56c3b79ddf7 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "test-staged" ], "dependencies": { + "@axe-core/puppeteer": "^4.1.1", "@types/chroma-js": "^2.0.0", "@types/lodash": "^4.14.160", "@types/numeral": "^0.0.28", @@ -115,7 +116,6 @@ "argparse": "^2.0.1", "autoprefixer": "^9.8.6", "axe-core": "^4.1.1", - "axe-puppeteer": "^1.1.1", "babel-core": "7.0.0-bridge.0", "babel-eslint": "^10.1.0", "babel-jest": "^24.1.0", diff --git a/scripts/a11y-testing.js b/scripts/a11y-testing.js index 4c846d2ce98e..330845ee1e82 100644 --- a/scripts/a11y-testing.js +++ b/scripts/a11y-testing.js @@ -19,7 +19,7 @@ const chalk = require('chalk'); const puppeteer = require('puppeteer'); -const { AxePuppeteer } = require('axe-puppeteer'); +const { AxePuppeteer } = require('@axe-core/puppeteer'); const docsPages = async (root, page) => { const pagesToSkip = [ diff --git a/src/components/popover/popover.tsx b/src/components/popover/popover.tsx index fbf56f14f3e2..332d3d3e24f2 100644 --- a/src/components/popover/popover.tsx +++ b/src/components/popover/popover.tsx @@ -745,6 +745,7 @@ export class EuiPopover extends Component { tabIndex={tabIndex} aria-live={ariaLive} role="dialog" + aria-label="Demo Tour" aria-modal="true" aria-describedby={ariaDescribedby} style={this.state.popoverStyles}> diff --git a/yarn.lock b/yarn.lock index a91fd0636ae6..104e447ca820 100755 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,13 @@ # yarn lockfile v1 +"@axe-core/puppeteer@^4.1.1": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@axe-core/puppeteer/-/puppeteer-4.1.1.tgz#e9dd2f2f13b717c057ff68c5943dec8d4ddd8acf" + integrity sha512-Ao9N7HL//s26hdasx3Ba18tlJgxpoO+1SmIN6eSx5vC50dqYhiRU0xp6wBKWqzo10u1jpzl/s4RFsOAuolFMBA== + dependencies: + axe-core "^4.1.1" + "@babel/cli@^7.10.5": version "7.10.5" resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.10.5.tgz#57df2987c8cf89d0fc7d4b157ec59d7619f1b77a" @@ -2762,7 +2769,7 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -axe-core@^3.5.3, axe-core@^3.5.4: +axe-core@^3.5.4: version "3.5.5" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-3.5.5.tgz#84315073b53fa3c0c51676c588d59da09a192227" integrity sha512-5P0QZ6J5xGikH780pghEdbEKijCTrruK9KxtPZCFWUpef0f6GipO+xEZ5GKCb020mmqgbiNO6TcA55CriL784Q== @@ -2772,13 +2779,6 @@ axe-core@^4.1.1: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.1.tgz#70a7855888e287f7add66002211a423937063eaf" integrity sha512-5Kgy8Cz6LPC9DJcNb3yjAXTu3XihQgEdnIg50c//zOC/MyLP0Clg+Y8Sh9ZjjnvBrDZU4DgXS9C3T9r4/scGZQ== -axe-puppeteer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/axe-puppeteer/-/axe-puppeteer-1.1.1.tgz#e95f46e069d84d388cdc9fc0630cf2b2e78b1100" - integrity sha512-bU7dt3zlXrlTmaBsudeACEkQ0O4a5LNxRCdA1Qfph4mqx/DewybPCrlyDqJlHXb/W7ZSodE1fMmC+MgRLizxuQ== - dependencies: - axe-core "^3.5.3" - axios@^0.18.0, axios@^0.18.1: version "0.18.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.1.tgz#ff3f0de2e7b5d180e757ad98000f1081b87bcea3" From 8aec3a7e116ec5445342a510b5d7d405e9528d77 Mon Sep 17 00:00:00 2001 From: Akash Gupta Date: Thu, 4 Feb 2021 06:59:58 +0530 Subject: [PATCH 2/8] updated snapshots Signed-off-by: Akash Gupta --- .../__snapshots__/super_select.test.tsx.snap | 3 +++ .../popover/__snapshots__/popover.test.tsx.snap | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap b/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap index 54bbc3c47e51..0313fed1a3f9 100644 --- a/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap +++ b/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap @@ -166,6 +166,7 @@ exports[`EuiSuperSelect props custom display is propagated to dropdown 1`] = ` data-focus-lock-disabled="disabled" >
Date: Thu, 4 Feb 2021 07:25:55 +0530 Subject: [PATCH 3/8] Cl --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1451858e10d..de46d58c0044 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) +- Migrated dependency `axe-puppeteer v1.1.1` to `@axe-core/puppeteer v4.1.1` ([#4482](https://github.com/elastic/eui/pull/4482)) - Added `isLoading` prop and added `EuiOverlayMask` directly to `EuiConfirmModal` ([#4421](https://github.com/elastic/eui/pull/4421)) **Bug fixes** From 4ced01316fbe90895b24aa14f7688116d281e377 Mon Sep 17 00:00:00 2001 From: Akash Gupta Date: Fri, 5 Feb 2021 10:28:31 +0530 Subject: [PATCH 4/8] resolved Tour page a11y --- .../__snapshots__/super_select.test.tsx.snap | 3 --- .../popover/__snapshots__/popover.test.tsx.snap | 10 ---------- src/components/popover/popover.tsx | 7 ++++++- src/components/tour/tour_step.tsx | 6 +++++- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap b/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap index 0313fed1a3f9..54bbc3c47e51 100644 --- a/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap +++ b/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap @@ -166,7 +166,6 @@ exports[`EuiSuperSelect props custom display is propagated to dropdown 1`] = ` data-focus-lock-disabled="disabled" >
{ display, onTrapDeactivation, buffer, + ariaLabelledId, container, ...rest } = this.props; @@ -745,7 +750,7 @@ export class EuiPopover extends Component { tabIndex={tabIndex} aria-live={ariaLive} role="dialog" - aria-label="Demo Tour" + aria-labelledby={ariaLabelledId} aria-modal="true" aria-describedby={ariaDescribedby} style={this.state.popoverStyles}> diff --git a/src/components/tour/tour_step.tsx b/src/components/tour/tour_step.tsx index 96707fba7b4d..8a80dfc06466 100644 --- a/src/components/tour/tour_step.tsx +++ b/src/components/tour/tour_step.tsx @@ -40,6 +40,7 @@ import { import { EuiTitle } from '../title'; import { EuiTourStepIndicator, EuiTourStepStatus } from './tour_step_indicator'; +import { htmlIdGenerator } from '../../services'; type PopoverOverrides = 'button' | 'closePopover'; @@ -132,6 +133,8 @@ export const EuiTourStep: FunctionComponent = ({ footerAction, ...rest }) => { + const generatedId = htmlIdGenerator(); + const titleId = generatedId(); if (step === 0) { console.warn( 'EuiTourStep `step` should 1-based indexing. Please update to eliminate 0 indexes.' @@ -216,9 +219,10 @@ export const EuiTourStep: FunctionComponent = ({ panelClassName={classes} panelStyle={newStyle || style} offset={hasBeacon ? 10 : 0} + ariaLabelledId={titleId} arrowChildren={hasBeacon && } {...rest}> - +

{subtitle}

From 764e681c354cd9920f715169e57e17944954f0b1 Mon Sep 17 00:00:00 2001 From: Akash Gupta Date: Fri, 5 Feb 2021 22:26:40 +0530 Subject: [PATCH 5/8] changes --- .../popover/__snapshots__/popover.test.tsx.snap | 1 - src/components/popover/popover.tsx | 15 +++++++++++---- .../tour/__snapshots__/tour_step.test.tsx.snap | 5 ----- src/components/tour/tour_step.tsx | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/popover/__snapshots__/popover.test.tsx.snap b/src/components/popover/__snapshots__/popover.test.tsx.snap index eecbe9554688..4621d7afd97c 100644 --- a/src/components/popover/__snapshots__/popover.test.tsx.snap +++ b/src/components/popover/__snapshots__/popover.test.tsx.snap @@ -15,7 +15,6 @@ exports[`EuiPopover children is rendered 1`] = ` exports[`EuiPopover is rendered 1`] = `
{ display, onTrapDeactivation, buffer, - ariaLabelledId, + 'aria-label': ariaLabel, + 'aria-labelledby': ariaLabelledBy, container, ...rest } = this.props; @@ -750,7 +756,8 @@ export class EuiPopover extends Component { tabIndex={tabIndex} aria-live={ariaLive} role="dialog" - aria-labelledby={ariaLabelledId} + aria-label={ariaLabel} + aria-labelledby={ariaLabelledBy} aria-modal="true" aria-describedby={ariaDescribedby} style={this.state.popoverStyles}> diff --git a/src/components/tour/__snapshots__/tour_step.test.tsx.snap b/src/components/tour/__snapshots__/tour_step.test.tsx.snap index c883b88d6622..d1434a1e9286 100644 --- a/src/components/tour/__snapshots__/tour_step.test.tsx.snap +++ b/src/components/tour/__snapshots__/tour_step.test.tsx.snap @@ -2,7 +2,6 @@ exports[`EuiTourStep can be closed 1`] = `
= ({ panelClassName={classes} panelStyle={newStyle || style} offset={hasBeacon ? 10 : 0} - ariaLabelledId={titleId} + aria-labelledby={titleId} arrowChildren={hasBeacon && } {...rest}> From 61afb8fb54c4b592eebeaeaf8e336adb1b8cb52a Mon Sep 17 00:00:00 2001 From: Akash Gupta Date: Tue, 9 Feb 2021 05:28:41 +0530 Subject: [PATCH 6/8] updated snapshots --- .../table/mobile/__snapshots__/table_sort_mobile.test.tsx.snap | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/table/mobile/__snapshots__/table_sort_mobile.test.tsx.snap b/src/components/table/mobile/__snapshots__/table_sort_mobile.test.tsx.snap index e225bccb53ca..d71fd0ff7446 100644 --- a/src/components/table/mobile/__snapshots__/table_sort_mobile.test.tsx.snap +++ b/src/components/table/mobile/__snapshots__/table_sort_mobile.test.tsx.snap @@ -5,7 +5,6 @@ exports[`EuiTableSortMobile is rendered 1`] = ` class="euiTableSortMobile testClass1 testClass2" >
From 20ad6c10b9b746eb2863f749e78980db260fe7ef Mon Sep 17 00:00:00 2001 From: Michail Yasonik Date: Tue, 9 Feb 2021 11:33:05 -0500 Subject: [PATCH 7/8] ignore iframe contents --- scripts/a11y-testing.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/a11y-testing.js b/scripts/a11y-testing.js index 330845ee1e82..cecccabf414f 100644 --- a/scripts/a11y-testing.js +++ b/scripts/a11y-testing.js @@ -108,6 +108,7 @@ const printResult = (result) => }, ], }) + .exclude('iframe *') .analyze(); if (violations.length > 0) { From 9321ac483ba3f0f66d28e222b70af00613db1ad6 Mon Sep 17 00:00:00 2001 From: Michail Yasonik Date: Tue, 9 Feb 2021 13:55:50 -0500 Subject: [PATCH 8/8] ignore iframe contents a different way --- scripts/a11y-testing.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/a11y-testing.js b/scripts/a11y-testing.js index cecccabf414f..e9442604b79f 100644 --- a/scripts/a11y-testing.js +++ b/scripts/a11y-testing.js @@ -106,9 +106,13 @@ const printResult = (result) => id: 'scrollable-region-focusable', selector: '[data-skip-axe="scrollable-region-focusable"]', }, + { + // can remove after https://github.com/dequelabs/axe-core/issues/2690 is resolved + id: 'region', + selector: 'iframe, #player,', + }, ], }) - .exclude('iframe *') .analyze(); if (violations.length > 0) {