diff --git a/packages/visx-tooltip/src/tooltips/Tooltip.tsx b/packages/visx-tooltip/src/tooltips/Tooltip.tsx index d40425e0f..1c2ce352b 100644 --- a/packages/visx-tooltip/src/tooltips/Tooltip.tsx +++ b/packages/visx-tooltip/src/tooltips/Tooltip.tsx @@ -13,7 +13,6 @@ export type TooltipProps = { }; export const defaultStyles: React.CSSProperties = { - position: 'absolute', backgroundColor: 'white', color: '#666666', padding: '.3rem .5rem', @@ -39,8 +38,13 @@ export default function Tooltip({
diff --git a/packages/visx-tooltip/test/TooltipWithBounds.test.tsx b/packages/visx-tooltip/test/TooltipWithBounds.test.tsx index 8db249323..b7eaa53c7 100644 --- a/packages/visx-tooltip/test/TooltipWithBounds.test.tsx +++ b/packages/visx-tooltip/test/TooltipWithBounds.test.tsx @@ -21,7 +21,11 @@ describe('', () => { const wrapper = shallow(Hello, { disableLifecycleMethods: true, }).dive(); - const styles = wrapper.find('Tooltip').props().style as any; + const styles = wrapper + .find('Tooltip') + .dive() + .find('.visx-tooltip') + .props().style as any; Object.keys(defaultStyles).forEach(key => { expect(styles[key]).toBeUndefined(); });