ref(toolbar): add accessibility labels for torture tests (#2685)
* ref(toolbar): add accessibility labels for torture tests * squash: update propTypes
This commit is contained in:
parent
f8717a7135
commit
7c08116dc2
|
@ -273,6 +273,7 @@ class InfoDialogButton extends Component {
|
||||||
onClose = { this._onDialogClose }
|
onClose = { this._onDialogClose }
|
||||||
position = { 'top right' }>
|
position = { 'top right' }>
|
||||||
<ToolbarButtonV2
|
<ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Info'
|
||||||
iconName = { iconClass }
|
iconName = { iconClass }
|
||||||
onClick = { this._onDialogToggle }
|
onClick = { this._onDialogToggle }
|
||||||
tooltip = { t('info.tooltip') } />
|
tooltip = { t('info.tooltip') } />
|
||||||
|
|
|
@ -13,6 +13,12 @@ export default class AbstractToolbarButton extends Component {
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
/**
|
||||||
|
* A succinct description of what the button does. Used by accessibility
|
||||||
|
* tools and torture tests.
|
||||||
|
*/
|
||||||
|
accessibilityLabel: PropTypes.string,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the Icon of this {@code AbstractToolbarButton}.
|
* The name of the Icon of this {@code AbstractToolbarButton}.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -72,6 +72,7 @@ class OverflowMenuButton extends Component {
|
||||||
onClose = { this._onCloseDialog }
|
onClose = { this._onCloseDialog }
|
||||||
position = { 'top right' }>
|
position = { 'top right' }>
|
||||||
<ToolbarButtonV2
|
<ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Overflow'
|
||||||
iconName = { iconClasses }
|
iconName = { iconClasses }
|
||||||
onClick = { this._onToggleDialogVisibility }
|
onClick = { this._onToggleDialogVisibility }
|
||||||
tooltip = { t('toolbar.moreActions') } />
|
tooltip = { t('toolbar.moreActions') } />
|
||||||
|
|
|
@ -14,6 +14,12 @@ class OverflowMenuItem extends Component {
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
/**
|
||||||
|
* A succinct description of what the item does. Used by accessibility
|
||||||
|
* tools and torture tests.
|
||||||
|
*/
|
||||||
|
accessibilityLabel: PropTypes.string,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The icon class to use for displaying an icon before the link text.
|
* The icon class to use for displaying an icon before the link text.
|
||||||
*/
|
*/
|
||||||
|
@ -39,6 +45,7 @@ class OverflowMenuItem extends Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
|
aria-label = { this.props.accessibilityLabel }
|
||||||
className = 'overflow-menu-item'
|
className = 'overflow-menu-item'
|
||||||
onClick = { this.props.onClick }>
|
onClick = { this.props.onClick }>
|
||||||
<span className = 'overflow-menu-item-icon'>
|
<span className = 'overflow-menu-item-icon'>
|
||||||
|
|
|
@ -74,6 +74,7 @@ class OverflowMenuProfileItem extends Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
|
aria-label = 'Profile'
|
||||||
className = { classNames }
|
className = { classNames }
|
||||||
onClick = { this._onClick }>
|
onClick = { this._onClick }>
|
||||||
<span className = 'overflow-menu-item-icon'>
|
<span className = 'overflow-menu-item-icon'>
|
||||||
|
|
|
@ -50,6 +50,7 @@ class ToolbarButtonV2 extends AbstractToolbarButton {
|
||||||
_renderButton(children) {
|
_renderButton(children) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
aria-label = { this.props.accessibilityLabel }
|
||||||
className = 'toolbox-button'
|
className = 'toolbox-button'
|
||||||
onClick = { this.props.onClick }>
|
onClick = { this.props.onClick }>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|
|
@ -45,13 +45,16 @@ class ToolboxFilmstrip extends Component<*> {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className = 'filmstrip-toolbox'>
|
<div
|
||||||
|
className = 'filmstrip-toolbox'
|
||||||
|
id = 'new-toolbox'>
|
||||||
{ this._shouldShowButton('microphone')
|
{ this._shouldShowButton('microphone')
|
||||||
&& <AudioMuteButton tooltipPosition = 'left' /> }
|
&& <AudioMuteButton tooltipPosition = 'left' /> }
|
||||||
{ this._shouldShowButton('camera')
|
{ this._shouldShowButton('camera')
|
||||||
&& <VideoMuteButton tooltipPosition = 'left' /> }
|
&& <VideoMuteButton tooltipPosition = 'left' /> }
|
||||||
{ this._shouldShowButton('fodeviceselection')
|
{ this._shouldShowButton('fodeviceselection')
|
||||||
&& <ToolbarButtonV2
|
&& <ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Settings'
|
||||||
iconName = 'icon-settings'
|
iconName = 'icon-settings'
|
||||||
onClick = { this._onToolbarOpenSettings }
|
onClick = { this._onToolbarOpenSettings }
|
||||||
tooltip = { t('toolbar.Settings') }
|
tooltip = { t('toolbar.Settings') }
|
||||||
|
|
|
@ -333,6 +333,7 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
&& this._renderDesktopSharingButton() }
|
&& this._renderDesktopSharingButton() }
|
||||||
{ this._shouldShowButton('raisehand')
|
{ this._shouldShowButton('raisehand')
|
||||||
&& <ToolbarButtonV2
|
&& <ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Raised hand'
|
||||||
iconName = { _raisedHand
|
iconName = { _raisedHand
|
||||||
? 'icon-raised-hand toggled'
|
? 'icon-raised-hand toggled'
|
||||||
: 'icon-raised-hand' }
|
: 'icon-raised-hand' }
|
||||||
|
@ -341,6 +342,7 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
{ this._shouldShowButton('chat')
|
{ this._shouldShowButton('chat')
|
||||||
&& <div className = 'toolbar-button-with-badge'>
|
&& <div className = 'toolbar-button-with-badge'>
|
||||||
<ToolbarButtonV2
|
<ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Chat'
|
||||||
iconName = { _chatOpen
|
iconName = { _chatOpen
|
||||||
? 'icon-chat toggled'
|
? 'icon-chat toggled'
|
||||||
: 'icon-chat' }
|
: 'icon-chat' }
|
||||||
|
@ -361,6 +363,7 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
{ this._shouldShowButton('invite')
|
{ this._shouldShowButton('invite')
|
||||||
&& !_hideInviteButton
|
&& !_hideInviteButton
|
||||||
&& <ToolbarButtonV2
|
&& <ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Invite'
|
||||||
iconName = 'icon-add'
|
iconName = 'icon-add'
|
||||||
onClick = { this._onToolbarOpenInvite }
|
onClick = { this._onToolbarOpenInvite }
|
||||||
tooltip = { t('addPeople.title') } /> }
|
tooltip = { t('addPeople.title') } /> }
|
||||||
|
@ -369,7 +372,9 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
&& <OverflowMenuButton
|
&& <OverflowMenuButton
|
||||||
isOpen = { this.state.showOverflowMenu }
|
isOpen = { this.state.showOverflowMenu }
|
||||||
onVisibilityChange = { this._onSetOverflowVisible }>
|
onVisibilityChange = { this._onSetOverflowVisible }>
|
||||||
<ul className = 'overflow-menu'>
|
<ul
|
||||||
|
aria-label = 'Overflow menu'
|
||||||
|
className = 'overflow-menu'>
|
||||||
{ overflowMenuContent }
|
{ overflowMenuContent }
|
||||||
</ul>
|
</ul>
|
||||||
</OverflowMenuButton> }
|
</OverflowMenuButton> }
|
||||||
|
@ -940,6 +945,7 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ToolbarButtonV2
|
<ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Screenshare'
|
||||||
iconName = { classNames }
|
iconName = { classNames }
|
||||||
onClick = { this._onToolbarToggleScreenshare }
|
onClick = { this._onToolbarToggleScreenshare }
|
||||||
tooltip = { tooltip } />
|
tooltip = { tooltip } />
|
||||||
|
@ -969,12 +975,14 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
onClick = { this._onToolbarToggleProfile } />,
|
onClick = { this._onToolbarToggleProfile } />,
|
||||||
this._shouldShowButton('settings')
|
this._shouldShowButton('settings')
|
||||||
&& <OverflowMenuItem
|
&& <OverflowMenuItem
|
||||||
|
accessibilityLabel = 'Settings'
|
||||||
icon = 'icon-settings'
|
icon = 'icon-settings'
|
||||||
key = 'settings'
|
key = 'settings'
|
||||||
onClick = { this._onToolbarToggleSettings }
|
onClick = { this._onToolbarToggleSettings }
|
||||||
text = { t('toolbar.Settings') } />,
|
text = { t('toolbar.Settings') } />,
|
||||||
this._shouldShowButton('sharedvideo')
|
this._shouldShowButton('sharedvideo')
|
||||||
&& <OverflowMenuItem
|
&& <OverflowMenuItem
|
||||||
|
accessibilityLabel = 'Shared video'
|
||||||
icon = 'icon-shared-video'
|
icon = 'icon-shared-video'
|
||||||
key = 'sharedvideo'
|
key = 'sharedvideo'
|
||||||
onClick = { this._onToolbarToggleSharedVideo }
|
onClick = { this._onToolbarToggleSharedVideo }
|
||||||
|
@ -984,6 +992,7 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
this._shouldShowButton('etherpad')
|
this._shouldShowButton('etherpad')
|
||||||
&& _etherpadInitialized
|
&& _etherpadInitialized
|
||||||
&& <OverflowMenuItem
|
&& <OverflowMenuItem
|
||||||
|
accessibilityLabel = 'Etherpad'
|
||||||
icon = 'icon-share-doc'
|
icon = 'icon-share-doc'
|
||||||
key = 'etherpad'
|
key = 'etherpad'
|
||||||
onClick = { this._onToolbarToggleEtherpad }
|
onClick = { this._onToolbarToggleEtherpad }
|
||||||
|
@ -992,6 +1001,7 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
: t('toolbar.documentOpen') } />,
|
: t('toolbar.documentOpen') } />,
|
||||||
this._shouldShowButton('fullscreen')
|
this._shouldShowButton('fullscreen')
|
||||||
&& <OverflowMenuItem
|
&& <OverflowMenuItem
|
||||||
|
accessibilityLabel = 'Full screen'
|
||||||
icon = { _fullScreen
|
icon = { _fullScreen
|
||||||
? 'icon-exit-full-screen'
|
? 'icon-exit-full-screen'
|
||||||
: 'icon-full-screen' }
|
: 'icon-full-screen' }
|
||||||
|
@ -1003,12 +1013,14 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
this._renderRecordingButton(),
|
this._renderRecordingButton(),
|
||||||
this._shouldShowButton('videoquality')
|
this._shouldShowButton('videoquality')
|
||||||
&& <OverflowMenuItem
|
&& <OverflowMenuItem
|
||||||
|
accessibilityLabel = 'Call quality'
|
||||||
icon = { 'icon-visibility' }
|
icon = { 'icon-visibility' }
|
||||||
key = 'videoquality'
|
key = 'videoquality'
|
||||||
onClick = { this._onToolbarOpenVideoQuality }
|
onClick = { this._onToolbarOpenVideoQuality }
|
||||||
text = { t('toolbar.callQuality') } />,
|
text = { t('toolbar.callQuality') } />,
|
||||||
this._shouldShowButton('stats')
|
this._shouldShowButton('stats')
|
||||||
&& <OverflowMenuItem
|
&& <OverflowMenuItem
|
||||||
|
accessibilityLabel = 'Speaker stats'
|
||||||
icon = 'icon-presentation'
|
icon = 'icon-presentation'
|
||||||
key = 'stats'
|
key = 'stats'
|
||||||
onClick = { this._onToolbarOpenSpeakerStats }
|
onClick = { this._onToolbarOpenSpeakerStats }
|
||||||
|
@ -1016,12 +1028,14 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
this._shouldShowButton('feedback')
|
this._shouldShowButton('feedback')
|
||||||
&& _feedbackConfigured
|
&& _feedbackConfigured
|
||||||
&& <OverflowMenuItem
|
&& <OverflowMenuItem
|
||||||
|
accessibilityLabel = 'Feedback'
|
||||||
icon = 'icon-feedback'
|
icon = 'icon-feedback'
|
||||||
key = 'feedback'
|
key = 'feedback'
|
||||||
onClick = { this._onToolbarOpenFeedback }
|
onClick = { this._onToolbarOpenFeedback }
|
||||||
text = { t('toolbar.feedback') } />,
|
text = { t('toolbar.feedback') } />,
|
||||||
this._shouldShowButton('shortcuts')
|
this._shouldShowButton('shortcuts')
|
||||||
&& <OverflowMenuItem
|
&& <OverflowMenuItem
|
||||||
|
accessibilityLabel = 'Shortcuts'
|
||||||
icon = 'icon-open_in_new'
|
icon = 'icon-open_in_new'
|
||||||
key = 'shortcuts'
|
key = 'shortcuts'
|
||||||
onClick = { this._onToolbarOpenKeyboardShortcuts }
|
onClick = { this._onToolbarOpenKeyboardShortcuts }
|
||||||
|
@ -1062,6 +1076,7 @@ class ToolboxV2 extends Component<Props, State> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OverflowMenuItem
|
<OverflowMenuItem
|
||||||
|
accessibilityLabel = 'Record'
|
||||||
icon = 'fa fa-play-circle'
|
icon = 'fa fa-play-circle'
|
||||||
key = 'recording'
|
key = 'recording'
|
||||||
onClick = { this._onToolbarToggleRecording }
|
onClick = { this._onToolbarToggleRecording }
|
||||||
|
|
|
@ -112,6 +112,7 @@ export class AudioMuteButton extends AbstractAudioMuteButton {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ToolbarButtonV2
|
<ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Audio mute'
|
||||||
iconName = { _audioMuted && _conference
|
iconName = { _audioMuted && _conference
|
||||||
? 'icon-mic-disabled toggled'
|
? 'icon-mic-disabled toggled'
|
||||||
: 'icon-microphone' }
|
: 'icon-microphone' }
|
||||||
|
|
|
@ -59,6 +59,7 @@ export class HangupButton extends AbstractHangupButton {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ToolbarButtonV2
|
<ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Hangup'
|
||||||
iconName = 'icon-hangup'
|
iconName = 'icon-hangup'
|
||||||
onClick = { this._onToolbarHangup }
|
onClick = { this._onToolbarHangup }
|
||||||
tooltip = { t('toolbar.hangup') }
|
tooltip = { t('toolbar.hangup') }
|
||||||
|
|
|
@ -107,6 +107,7 @@ export class VideoMuteButton extends AbstractVideoMuteButton {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ToolbarButtonV2
|
<ToolbarButtonV2
|
||||||
|
accessibilityLabel = 'Video mute'
|
||||||
iconName = { _videoMuted && _conference
|
iconName = { _videoMuted && _conference
|
||||||
? 'icon-camera-disabled toggled'
|
? 'icon-camera-disabled toggled'
|
||||||
: 'icon-camera' }
|
: 'icon-camera' }
|
||||||
|
|
Loading…
Reference in New Issue