File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -119,8 +119,8 @@ L${point(-shaftLength, shaftWidth / 2)}${unclosed ? '' : ' z'}`
119119 propsForPath . clipPath = `url(#${ clipPathId } )`
120120 }
121121 const style = propsForSvg . style = ( propsForSvg . style ? { ...propsForSvg . style } : { } )
122- style . width = width
123- style . height = height
122+ if ( style . width == null ) style . width = width
123+ if ( style . height == null ) style . height = height
124124
125125 return (
126126 < svg { ...propsForSvg } >
Original file line number Diff line number Diff line change @@ -191,5 +191,21 @@ L15,0
191191L5,0
192192L5,-10 z` )
193193 } )
194+ it ( 'allows style.width and style.height to be overridden' , ( ) => {
195+ const comp = mount (
196+ < Arrow
197+ direction = "down"
198+ shaftWidth = { 10 }
199+ shaftLength = { 10 }
200+ headWidth = { 30 }
201+ headLength = { 15 }
202+ style = { { width : 3 , height : 4 } }
203+ />
204+ )
205+ const svg = comp . find ( 'svg' )
206+ const style = svg . prop ( 'style' )
207+ expect ( style . width ) . to . equal ( 3 )
208+ expect ( style . height ) . to . equal ( 4 )
209+ } )
194210} )
195211
You can’t perform that action at this time.
0 commit comments