Browse Source

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.
j8
Leonard Kim 7 years ago
parent
commit
05f8c69fe6
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      react/features/toolbox/components/ToolbarButton.web.js

+ 7
- 2
react/features/toolbox/components/ToolbarButton.web.js View File

@@ -156,13 +156,14 @@ class ToolbarButton extends Component {
156 156
                 <StatelessToolbarButton { ...props } />
157 157
             </Tooltip>
158 158
         );
159
+        let children = buttonComponent;
159 160
 
160 161
         const popupConfig = this._getPopupDisplayConfiguration();
161 162
 
162 163
         if (popupConfig) {
163 164
             const { dataAttr, dataInterpolate, position } = popupConfig;
164 165
 
165
-            return (
166
+            children = ( // eslint-disable-line no-extra-parens
166 167
                 <AKInlineDialog
167 168
                     content = { t(dataAttr, dataInterpolate) }
168 169
                     isOpen = { Boolean(popupConfig) }
@@ -172,7 +173,11 @@ class ToolbarButton extends Component {
172 173
             );
173 174
         }
174 175
 
175
-        return buttonComponent;
176
+        return (
177
+            <div className = { `toolbar-button-wrapper ${button.id}-wrapper` }>
178
+                { children }
179
+            </div>
180
+        );
176 181
     }
177 182
 
178 183
     /**

Loading…
Cancel
Save