import React from 'react'; import {Button, Modal, Progress} from './Theme'; import {renderInDarkMode, renderInLightMode} from '../test-utils'; // All semantic-ui colors. const allColors = ['red', 'orange', 'yellow', 'olive', 'green', 'teal', 'blue', 'violet', 'purple', 'pink', 'brown', 'grey']; // Light bar colors that always need dark percent text (light bars in any theme). const lightBarColors = ['yellow', 'olive', 'teal']; // Bar colors that need dark percent text only in dark mode (inverted makes bar lighter). const darkModeLightBarColors = ['grey', 'blue']; describe('Button ref forwarding', () => { // Regression: SButton is a class component, so forwarding a ref straight to it resolves to the class instance // (no `.contains`). Semantic UI's Modal/Popup Portal calls `node.contains(...)` on the trigger's ref during // handleDocumentClick, throwing "node.contains is not a function". The forwarded ref must be the DOM