Ver código fonte

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 anos atrás
pai
commit
05f8c69fe6

+ 7
- 2
react/features/toolbox/components/ToolbarButton.web.js Ver arquivo

156
                 <StatelessToolbarButton { ...props } />
156
                 <StatelessToolbarButton { ...props } />
157
             </Tooltip>
157
             </Tooltip>
158
         );
158
         );
159
+        let children = buttonComponent;
159
 
160
 
160
         const popupConfig = this._getPopupDisplayConfiguration();
161
         const popupConfig = this._getPopupDisplayConfiguration();
161
 
162
 
162
         if (popupConfig) {
163
         if (popupConfig) {
163
             const { dataAttr, dataInterpolate, position } = popupConfig;
164
             const { dataAttr, dataInterpolate, position } = popupConfig;
164
 
165
 
165
-            return (
166
+            children = ( // eslint-disable-line no-extra-parens
166
                 <AKInlineDialog
167
                 <AKInlineDialog
167
                     content = { t(dataAttr, dataInterpolate) }
168
                     content = { t(dataAttr, dataInterpolate) }
168
                     isOpen = { Boolean(popupConfig) }
169
                     isOpen = { Boolean(popupConfig) }
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
     /**

Carregando…
Cancelar
Salvar