diff --git a/packages/vx-tooltip/test/TooltipWithBounds.test.tsx b/packages/vx-tooltip/test/TooltipWithBounds.test.tsx index 9906de765..8db249323 100644 --- a/packages/vx-tooltip/test/TooltipWithBounds.test.tsx +++ b/packages/vx-tooltip/test/TooltipWithBounds.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { mount } from 'enzyme'; -import { TooltipWithBounds, defaultStyles, Tooltip } from '../src'; +import { shallow } from 'enzyme'; +import { TooltipWithBounds, defaultStyles } from '../src'; describe('', () => { test('it should be defined', () => { @@ -8,16 +8,20 @@ describe('', () => { }); it('should render the Tooltip with default styles by default', () => { - const wrapper = mount(Hello); - const styles = wrapper.find(Tooltip).props().style as any; + const wrapper = shallow(Hello, { + disableLifecycleMethods: true, + }).dive(); + const styles = wrapper.find('Tooltip').props().style as any; Object.entries(defaultStyles).forEach(([key, value]) => { expect(styles[key]).toBe(value); }); }); it('should render the tooltip without default styles if unstyled is set to true', () => { - const wrapper = mount(Hello); - const styles = wrapper.find(Tooltip).props().style as any; + const wrapper = shallow(Hello, { + disableLifecycleMethods: true, + }).dive(); + const styles = wrapper.find('Tooltip').props().style as any; Object.keys(defaultStyles).forEach(key => { expect(styles[key]).toBeUndefined(); });