-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converge suggested actions into live region twin and add roving tab i…
…ndex (#4314) * Change suggested actions into role="toolbar" * Clean up * Update ports * Add suggested actions to live region twin * Fix tests * Fix tests * Fix tests * Fix tests * Fix tests * Fix tests * Fix tests * Fix tests * Add entry * Fit tests * Rename * Incorp PR comments * Incorp PR changes
- Loading branch information
Showing
80 changed files
with
1,101 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+23.8 KB
...essibility-requirement-suggested-actions-in-live-region-with-message-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21.3 KB
...ibility-requirement-suggested-actions-in-live-region-without-message-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file modified
BIN
+1.33 KB
(110%)
...access-key-js-suggested-actions-should-be-focusable-using-access-key-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+846 Bytes
(100%)
...access-key-js-suggested-actions-should-be-focusable-using-access-key-3-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.37 KB
(110%)
...ey-disabled-should-not-have-screen-reader-text-related-to-access-key-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+96 Bytes
(100%)
...ons-style-options-js-suggested-actions-when-overriding-style-options-3-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+95 Bytes
(100%)
...ons-style-options-js-suggested-actions-when-overriding-style-options-4-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+135 Bytes
(100%)
...ons-style-options-js-suggested-actions-when-overriding-style-options-5-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+125 Bytes
(100%)
...ons-style-options-js-suggested-actions-when-overriding-style-options-6-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+37 Bytes
(100%)
...s-js-suggested-actions-when-overriding-with-deprecated-style-options-3-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+34 Bytes
(100%)
...s-js-suggested-actions-when-overriding-with-deprecated-style-options-4-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+24 Bytes
(100%)
...s-js-suggested-actions-when-overriding-with-deprecated-style-options-5-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+35 Bytes
(100%)
...s-js-suggested-actions-when-overriding-with-deprecated-style-options-6-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+558 Bytes
(100%)
...-style-options-js-suggested-actions-when-using-default-style-options-3-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+572 Bytes
(100%)
...-style-options-js-suggested-actions-when-using-default-style-options-4-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+584 Bytes
(100%)
...-style-options-js-suggested-actions-when-using-default-style-options-5-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-13 Bytes
(100%)
...-style-options-js-suggested-actions-when-using-default-style-options-6-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+69.9 KB
...ions-js-transcript-navigation-should-scroll-into-view-based-on-input-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+69.9 KB
...ions-js-transcript-navigation-should-scroll-into-view-based-on-input-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+71.9 KB
...ions-js-transcript-navigation-should-scroll-into-view-based-on-input-3-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.6 KB
...transcript-navigation-should-scroll-into-view-after-pressing-tab-key-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+75.4 KB
...transcript-navigation-should-scroll-into-view-after-pressing-tab-key-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+70.2 KB
...transcript-navigation-should-scroll-into-view-after-pressing-tab-key-3-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+68.7 KB
...transcript-navigation-should-scroll-into-view-after-pressing-tab-key-4-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+70.9 KB
...transcript-navigation-should-scroll-into-view-after-pressing-tab-key-5-snap.png
Oops, something went wrong.
Binary file added
BIN
+75.4 KB
...transcript-navigation-should-scroll-into-view-after-pressing-tab-key-6-snap.png
Oops, something went wrong.
Binary file added
BIN
+74 KB
...-js-transcript-navigation-should-not-scroll-into-view-after-clicking-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+71 KB
...-js-transcript-navigation-should-not-scroll-into-view-after-clicking-2-snap.png
Oops, something went wrong.
Binary file added
BIN
+74 KB
...-js-transcript-navigation-should-not-scroll-into-view-after-clicking-3-snap.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
__tests__/html/accessibility.liveRegionSuggestedActions.withMessage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<link href="/assets/accessibility.liveRegionAttachment.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="/test-harness.js"></script> | ||
<script crossorigin="anonymous" src="/test-page-object.js"></script> | ||
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script> | ||
</head> | ||
<body> | ||
<div id="webchat"></div> | ||
<script> | ||
run(async function () { | ||
const baseActivity = { | ||
from: { | ||
id: 'bot', | ||
role: 'bot' | ||
}, | ||
textFormat: 'markdown', | ||
timestamp: new Date(2000, 0, 1, 12, 34, 56, 789).toISOString(), | ||
type: 'message' | ||
}; | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine: testHelpers.createDirectLineWithTranscript([ | ||
{ | ||
...baseActivity, | ||
suggestedActions: { | ||
actions: [ | ||
{ | ||
title: 'USA', | ||
type: 'imBack' | ||
}, | ||
{ | ||
title: 'Hong Kong', | ||
type: 'imBack' | ||
} | ||
] | ||
}, | ||
text: 'Where are you from?' | ||
} | ||
]), | ||
store: testHelpers.createStore(), | ||
styleOptions: { | ||
internalLiveRegionFadeAfter: 60000 | ||
} | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
await pageConditions.numActivitiesShown(1); | ||
await pageConditions.liveRegionStabilized(); | ||
|
||
const screenReaderTexts = [].map.call(pageElements.transcriptLiveRegion().children, child => | ||
testHelpers.getAllTextContents(child).join('\n') | ||
); | ||
|
||
expect(screenReaderTexts).toHaveLength(2); | ||
|
||
expect(screenReaderTexts[0]).toBe( | ||
'Bot said:\nWhere are you from?\nUSA\nHong Kong\nSent at January 1 at 12:34 PM' | ||
); | ||
expect(screenReaderTexts[1]).toBe('Suggested Actions Container: Has content. Press Alt + Shift + A to select.'); | ||
|
||
// The screenshot should show the suggested actions as HTML <button> and verify we sent a <button> to screen reader. | ||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
6 changes: 6 additions & 0 deletions
6
__tests__/html/accessibility.liveRegionSuggestedActions.withMessage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('accessibility requirement', () => { | ||
describe('suggested actions in live region', () => | ||
test('with message', () => runHTML('accessibility.liveRegionSuggestedActions.withMessage.html'))); | ||
}); |
70 changes: 70 additions & 0 deletions
70
__tests__/html/accessibility.liveRegionSuggestedActions.withoutMessage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<link href="/assets/accessibility.liveRegionAttachment.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="/test-harness.js"></script> | ||
<script crossorigin="anonymous" src="/test-page-object.js"></script> | ||
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script> | ||
</head> | ||
<body> | ||
<div id="webchat"></div> | ||
<script> | ||
run(async function () { | ||
const baseActivity = { | ||
from: { | ||
id: 'bot', | ||
role: 'bot' | ||
}, | ||
textFormat: 'markdown', | ||
timestamp: new Date(2000, 0, 1, 12, 34, 56, 789).toISOString(), | ||
type: 'message' | ||
}; | ||
|
||
WebChat.renderWebChat( | ||
{ | ||
directLine: testHelpers.createDirectLineWithTranscript([ | ||
{ | ||
...baseActivity, | ||
suggestedActions: { | ||
actions: [ | ||
{ | ||
title: 'What can I say?', | ||
type: 'imBack' | ||
}, | ||
{ | ||
title: 'What is the weather?', | ||
type: 'imBack' | ||
} | ||
] | ||
} | ||
} | ||
]), | ||
store: testHelpers.createStore(), | ||
styleOptions: { | ||
internalLiveRegionFadeAfter: 60000 | ||
} | ||
}, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
await pageConditions.liveRegionStabilized(); | ||
|
||
const screenReaderTexts = [].map.call(pageElements.transcriptLiveRegion().children, child => | ||
testHelpers.getAllTextContents(child).join('\n') | ||
); | ||
|
||
expect(screenReaderTexts).toHaveLength(2); | ||
|
||
expect(screenReaderTexts[0]).toBe( | ||
'Bot said:\nWhat can I say?\nWhat is the weather?\nSent at January 1 at 12:34 PM' | ||
); | ||
expect(screenReaderTexts[1]).toBe('Suggested Actions Container: Has content. Press Alt + Shift + A to select.'); | ||
|
||
// The screenshot should show the suggested actions as HTML <button> and verify we sent a <button> to screen reader. | ||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
6 changes: 6 additions & 0 deletions
6
__tests__/html/accessibility.liveRegionSuggestedActions.withoutMessage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */ | ||
|
||
describe('accessibility requirement', () => { | ||
describe('suggested actions in live region', () => | ||
test('without message', () => runHTML('accessibility.liveRegionSuggestedActions.withoutMessage.html'))); | ||
}); |
101 changes: 0 additions & 101 deletions
101
__tests__/html/accessibility.usability.suggestedActions.hideOnInitial.html
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
__tests__/html/accessibility.usability.suggestedActions.hideOnInitial.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.