From 5c89c08a3549f0be0bf9c8e209ab9406d0a3d92c Mon Sep 17 00:00:00 2001 From: Guillaume Date: Thu, 27 Sep 2018 16:25:50 +0100 Subject: [PATCH] fix(warning): warnings because of width auto / height auto on svg (#109) --- src/Atoms/Brand/BrandName.js | 11 +-- src/Atoms/Brand/BrandName.spec.js | 6 -- src/Atoms/Brand/BrandName.stories.js | 1 - .../__snapshots__/BrandName.spec.js.snap | 79 ++----------------- 4 files changed, 10 insertions(+), 87 deletions(-) diff --git a/src/Atoms/Brand/BrandName.js b/src/Atoms/Brand/BrandName.js index cd8b0669..57f3912e 100644 --- a/src/Atoms/Brand/BrandName.js +++ b/src/Atoms/Brand/BrandName.js @@ -5,13 +5,12 @@ import PropTypes from 'prop-types' const Wrapper = styled.svg.attrs({ viewBox: '0 0 397.4 43.7', })` - height: ${(props) => props.height}; - width: ${(props) => props.width}; + height: ${(props) => props.size}; fill: ${(props) => props.theme.brandNameColor}; ` -const BrandName = (props) => ( - +const BrandName = ({ height, ...rest }) => ( + ) - - expect(tree.find(BrandName)).toMatchSnapshot() - }) }) diff --git a/src/Atoms/Brand/BrandName.stories.js b/src/Atoms/Brand/BrandName.stories.js index ce11f1d3..85f13558 100644 --- a/src/Atoms/Brand/BrandName.stories.js +++ b/src/Atoms/Brand/BrandName.stories.js @@ -5,4 +5,3 @@ import BrandName from './BrandName' storiesOf('Atoms/Brand/BrandName', module) .add('default', () => ) .add('with height', () => ) - .add('with width', () => ) diff --git a/src/Atoms/Brand/__snapshots__/BrandName.spec.js.snap b/src/Atoms/Brand/__snapshots__/BrandName.spec.js.snap index 154ed773..5765db33 100644 --- a/src/Atoms/Brand/__snapshots__/BrandName.spec.js.snap +++ b/src/Atoms/Brand/__snapshots__/BrandName.spec.js.snap @@ -2,24 +2,20 @@ exports[`BrandName should render correctly 1`] = ` .c0 { - height: auto; - width: auto; + height: 1rem; fill: #999B9E; } - - - - - - - - - - - - - -`; - -exports[`BrandName should render correctly with width 1`] = ` -.c0 { - height: auto; - width: 300px; - fill: #999B9E; -} - - - -