Added getElement and getElements to enzyme types (#20116)

This commit is contained in:
Émile Filteau-Tessier
2017-10-02 13:37:47 -04:00
committed by Ryan Cavanaugh
parent 8055d9b2b1
commit 44443f8e49
2 changed files with 26 additions and 0 deletions

View File

@@ -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();
}

View File

@@ -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.
*/