瀏覽代碼

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 8 年之前
父節點
當前提交
05f8c69fe6
共有 1 個檔案被更改,包括 7 行新增2 行删除
  1. 7
    2
      react/features/toolbox/components/ToolbarButton.web.js

+ 7
- 2
react/features/toolbox/components/ToolbarButton.web.js 查看文件

@@ -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…
取消
儲存