Skip to content

Commit

Permalink
a11y: accessibility issue 2068 (#2779)
Browse files Browse the repository at this point in the history
* fix: narrator does not announce reloading

* fix test case

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
  • Loading branch information
liweitian and cwhitten authored Apr 29, 2020
1 parent 6ab67b2 commit 012f8ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('<ErrorCallout />', () => {
/>
);

const container = document.querySelector('[role="alertdialog"]');
const container = document.querySelector('[ data-testid="errorCallout"]');
expect(container).toHaveTextContent('title test');

const tryButton = getByText(container as HTMLElement, 'Try again');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ export const ErrorCallout: React.FC<IErrorCalloutProps> = props => {
const { onDismiss, onTry, target, visible, error } = props;
return (
<Callout
role="alertdialog"
ariaLabelledBy="callout-label-id"
ariaDescribedBy="callout-description-id"
gapSpace={0}
target={target}
onDismiss={onDismiss}
setInitialFocus={true}
hidden={!visible}
data-testid={'errorCallout'}
ariaLabel={formatMessage(`{title}. {msg}`, { title: error.title, msg: error.message })}
>
<div css={calloutContainer}>
<p css={calloutLabel} id="callout-label-id">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ export const TestController: React.FC = () => {
hidden={showError}
onClick={handleOpenEmulator}
/>
<div
aria-live={'assertive'}
aria-label={formatMessage(`{ botStatus}`, {
botStatus: publishing ? 'Publishing' : reloading ? 'Reloading' : '',
})}
/>
<Loading botStatus={botStatus} />
<div ref={addRef}>
<ErrorInfo hidden={!showError} onClick={handleErrorButtonClick} count={errorLength} />
Expand Down

0 comments on commit 012f8ef

Please sign in to comment.