enzyme: Fix errors on <svg> element props

This commit is contained in:
rhysd
2016-11-22 15:16:23 +09:00
parent ab7d53abc8
commit 136b36d096
2 changed files with 7 additions and 2 deletions

View File

@@ -38,6 +38,7 @@ namespace ShallowWrapperTest {
objectVal: Object,
boolVal: Boolean,
stringVal: String,
numOrStringVal: number | string,
elementWrapper: ShallowWrapper<HTMLAttributes<{}>, {}>
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;
}
}

4
enzyme/index.d.ts vendored
View File

@@ -3,9 +3,9 @@
// Definitions by: Marian Palkus <https://github.com/MarianPalkus>, Cap3 <http://www.cap3.de>, Ivo Stratev <https://github.com/NoHomey>
// 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<any, any> {
}