diff --git a/enzyme/enzyme-tests.tsx b/enzyme/enzyme-tests.tsx index 815131f355..a97c33051e 100644 --- a/enzyme/enzyme-tests.tsx +++ b/enzyme/enzyme-tests.tsx @@ -38,6 +38,7 @@ namespace ShallowWrapperTest { objectVal: Object, boolVal: Boolean, stringVal: String, + numOrStringVal: number | string, elementWrapper: ShallowWrapper, {}> function test_shallow_options() { @@ -306,6 +307,10 @@ namespace ShallowWrapperTest { function test_isEmptyRender() { boolVal = shallowWrapper.isEmptyRender(); } + + function test_svg() { + numOrStringVal = shallowWrapper.find('svg').props().strokeWidth; + } } diff --git a/enzyme/index.d.ts b/enzyme/index.d.ts index d531d12f03..63907a5c58 100644 --- a/enzyme/index.d.ts +++ b/enzyme/index.d.ts @@ -3,9 +3,9 @@ // Definitions by: Marian Palkus , Cap3 , Ivo Stratev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { ReactElement, Component, StatelessComponent, ComponentClass, HTMLAttributes as ReactHTMLAttributes } from "react"; +import { ReactElement, Component, StatelessComponent, ComponentClass, HTMLAttributes as ReactHTMLAttributes, SVGAttributes as ReactSVGAttributes } from "react"; -type HTMLAttributes = ReactHTMLAttributes<{}>; +type HTMLAttributes = ReactHTMLAttributes<{}> & ReactSVGAttributes<{}>; export class ElementClass extends Component { }