diff --git a/src/rendering/Box/__snapshots__/test.js.snap b/src/rendering/Box/__snapshots__/test.js.snap index b20eee2..09f8dc1 100644 --- a/src/rendering/Box/__snapshots__/test.js.snap +++ b/src/rendering/Box/__snapshots__/test.js.snap @@ -156,174 +156,149 @@ Object { `; exports[`Box rendering 1`] = ` - - - - Example - - + + + + + Example + + + `; exports[`Box rendering with a corner radius 1`] = ` - - - - Example - - + + + + + Example + + + `; exports[`Box rendering with a label 1`] = ` - - - - Test box - - - Example - - + + + + + Test box + + + Example + + + `; exports[`Box rendering with props from layout 1`] = ` - - - - Test box - - - Example - - + + + + + Test box + + + Example + + + `; exports[`Box themes rendering a "anchor" Box 1`] = ` - - - - Example - - + + + + + Example + + + `; exports[`Box themes rendering a "capture" Box 1`] = ` - - - - Example - - + + + + + Example + + + `; exports[`Box themes rendering a "charClass" Box 1`] = ` - - - - Example - - + + + + + Example + + + `; exports[`Box themes rendering a "escape" Box 1`] = ` - - - - Example - - + + + + + Example + + + `; exports[`Box themes rendering a "literal" Box 1`] = ` - - - - Example - - + + + + + Example + + + `; diff --git a/src/rendering/Box/test.js b/src/rendering/Box/test.js index 2fc884e..f86e82d 100644 --- a/src/rendering/Box/test.js +++ b/src/rendering/Box/test.js @@ -1,7 +1,7 @@ jest.mock('rendering/getbbox', () => jest.fn()); import React from 'react'; -import { shallow } from 'enzyme'; +import { render } from 'react-testing-library'; import getBBox from 'rendering/getbbox'; @@ -9,24 +9,30 @@ import Box, { layout } from 'rendering/Box'; describe('Box', () => { test('rendering', () => { - const component = shallow( - Example + const { asFragment } = render( + + Example + ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); test('rendering with a corner radius', () => { - const component = shallow( - Example + const { asFragment } = render( + + Example + ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); test('rendering with a label', () => { - const component = shallow( - Example + const { asFragment } = render( + + Example + ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); test('rendering with props from layout', () => { @@ -39,46 +45,58 @@ describe('Box', () => { labelTransform: 'LABEL TRANSFORM', contentTransform: 'CONTENT TRANSFORM' }; - const component = shallow( - Example + const { asFragment } = render( + + Example + ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); describe('themes', () => { test('rendering a "literal" Box', () => { - const component = shallow( - Example + const { asFragment } = render( + + Example + ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); test('rendering a "escape" Box', () => { - const component = shallow( - Example + const { asFragment } = render( + + Example + ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); test('rendering a "charClass" Box', () => { - const component = shallow( - Example + const { asFragment } = render( + + Example + ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); test('rendering a "capture" Box', () => { - const component = shallow( - Example + const { asFragment } = render( + + Example + ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); test('rendering a "anchor" Box', () => { - const component = shallow( - Example + const { asFragment } = render( + + Example + ); - expect(component).toMatchSnapshot(); + expect(asFragment()).toMatchSnapshot(); }); });