mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Added getElement and getElements to enzyme types (#20116)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
8055d9b2b1
commit
44443f8e49
@@ -206,6 +206,14 @@ function ShallowWrapperTest() {
|
||||
reactElements = shallowWrapper.getNodes();
|
||||
}
|
||||
|
||||
function test_getElement() {
|
||||
reactElement = shallowWrapper.getElement();
|
||||
}
|
||||
|
||||
function test_getElements() {
|
||||
reactElements = shallowWrapper.getElements();
|
||||
}
|
||||
|
||||
function test_getDOMNode() {
|
||||
domElement = shallowWrapper.getDOMNode();
|
||||
}
|
||||
@@ -545,6 +553,14 @@ function ReactWrapperTest() {
|
||||
reactElements = reactWrapper.getNodes();
|
||||
}
|
||||
|
||||
function test_getElement() {
|
||||
reactElement = reactWrapper.getElement();
|
||||
}
|
||||
|
||||
function test_getElements() {
|
||||
reactElements = reactWrapper.getElements();
|
||||
}
|
||||
|
||||
function test_getDOMNode() {
|
||||
domElement = reactWrapper.getDOMNode();
|
||||
}
|
||||
|
||||
10
types/enzyme/index.d.ts
vendored
10
types/enzyme/index.d.ts
vendored
@@ -148,6 +148,16 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
*/
|
||||
getNodes(): Array<ReactElement<any>>;
|
||||
|
||||
/**
|
||||
* Returns the wrapper's underlying node.
|
||||
*/
|
||||
getElement(): ReactElement<any>;
|
||||
|
||||
/**
|
||||
* Returns the wrapper's underlying node.
|
||||
*/
|
||||
getElements(): Array<ReactElement<any>>;
|
||||
|
||||
/**
|
||||
* Returns the outer most DOMComponent of the current wrapper.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user