ref(toolbar): add wrapper around buttons for torture tests

The torture tests were looking for the anchor tag within each
button. However, that anchor could get blown away from a react
re-render. So instead, expose a way for the torture tests
to find the root node of the button.
This commit is contained in:
Leonard Kim 2017-08-29 16:38:13 -07:00 committed by Дамян Минков
parent 7063f144ef
commit 05f8c69fe6
1 changed files with 7 additions and 2 deletions

View File

@ -156,13 +156,14 @@ class ToolbarButton extends Component {
<StatelessToolbarButton { ...props } />
</Tooltip>
);
let children = buttonComponent;
const popupConfig = this._getPopupDisplayConfiguration();
if (popupConfig) {
const { dataAttr, dataInterpolate, position } = popupConfig;
return (
children = ( // eslint-disable-line no-extra-parens
<AKInlineDialog
content = { t(dataAttr, dataInterpolate) }
isOpen = { Boolean(popupConfig) }
@ -172,7 +173,11 @@ class ToolbarButton extends Component {
);
}
return buttonComponent;
return (
<div className = { `toolbar-button-wrapper ${button.id}-wrapper` }>
{ children }
</div>
);
}
/**