mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 00:18:20 +08:00
enzyme: Fix errors on <svg> element props
This commit is contained in:
@@ -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
4
enzyme/index.d.ts
vendored
@@ -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> {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user