File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1- # ` .ref(refName) => ReactWrapper `
1+ # ` .ref(refName) => ReactComponent `
22
3- Returns a wrapper of the node that matches the provided reference name.
3+ Returns the node that matches the provided reference name.
44
55
66NOTE: can only be called on a wrapper instance that is also the root instance.
@@ -12,7 +12,7 @@ NOTE: can only be called on a wrapper instance that is also the root instance.
1212
1313#### Returns
1414
15- ` ReactWrapper ` : A wrapper of the node that matches the provided reference name.
15+ ` ReactComponent ` : The node that matches the provided reference name.
1616
1717
1818
@@ -35,8 +35,7 @@ class Foo extends React.Component {
3535
3636``` jsx
3737const wrapper = mount (< Foo / > );
38- expect (wrapper .ref (' secondRef' ).prop (' amount' )).to .equal (4 );
39- expect (wrapper .ref (' secondRef' ).text ()).to .equal (' Second' );
38+ expect (wrapper .ref (' secondRef' ).innerText ).to .equal (' Second' );
4039```
4140
4241
Original file line number Diff line number Diff line change @@ -187,12 +187,12 @@ class ReactWrapper {
187187
188188 /**
189189 * If the root component contained a ref, you can access it here
190- * and get a wrapper around it .
190+ * and get an actual ref .
191191 *
192192 * NOTE: can only be called on a wrapper instance that is also the root instance.
193193 *
194194 * @param {String } refname
195- * @returns {ReactWrapper }
195+ * @returns {ReactComponent }
196196 */
197197 ref ( refname ) {
198198 if ( this [ ROOT ] !== this ) {
You can’t perform that action at this time.
0 commit comments