Skip to content

Commit fafebf0

Browse files
committed
Update signature of .type() in shallow.md
so that it matches the signature in ShallowWrapper/type.md. Update type() comment in ShallowWrapper.js so that it matches ShallowWrapper/type.md. Fix typo in ShallowWrapper/type.md Fix typo in ShallowWrapper/name.md Fix typo in ReactWrapper/name.md Fix typo in ReactWrapper/type.md
1 parent 4b1867e commit fafebf0

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

docs/api/ReactWrapper/name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `.name() => String|null`
22

33
Returns the name of the current node of this wrapper. If it's a composite component, this will be
4-
the name of the component. If it's native DOM node, it will be a string of the tag name. If it's
4+
the name of the component. If it's a native DOM node, it will be a string of the tag name. If it's
55
`null`, it will be `null`.
66

77
The order of precedence on returning the name is: `type.displayName` -> `type.name` -> `type`.

docs/api/ReactWrapper/type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `.type() => String|Function`
22

33
Returns the type of the current node of this wrapper. If it's a composite component, this will be
4-
the component constructor. If it's native DOM node, it will be a string of the tag name.
4+
the component constructor. If it's a native DOM node, it will be a string of the tag name.
55

66
Note: can only be called on a wrapper of a single node.
77

docs/api/ShallowWrapper/name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `.name() => String|null`
22

33
Returns the name of the current node of this wrapper. If it's a composite component, this will be
4-
the name of the top-most rendered component. If it's native DOM node, it will be a string of the
4+
the name of the top-most rendered component. If it's a native DOM node, it will be a string of the
55
tag name. If it's `null`, it will be `null`.
66

77
The order of precedence on returning the name is: `type.displayName` -> `type.name` -> `type`.

docs/api/ShallowWrapper/type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `.type() => String|Function|null`
22

33
Returns the type of the current node of this wrapper. If it's a composite component, this will be
4-
the component constructor. If it's native DOM node, it will be a string of the tag name. If it's `null`, it will be `null`.
4+
the component constructor. If it's a native DOM node, it will be a string of the tag name. If it's `null`, it will be `null`.
55

66
Note: can only be called on a wrapper of a single node.
77

docs/api/shallow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Calls `.forceUpdate()` on the root component instance.
192192
#### [`.debug() => String`](ShallowWrapper/debug.md)
193193
Returns a string representation of the current shallow render tree for debugging purposes.
194194

195-
#### [`.type() => String|Function`](ShallowWrapper/type.md)
195+
#### [`.type() => String|Function|null`](ShallowWrapper/type.md)
196196
Returns the type of the current node of the wrapper.
197197

198198
#### [`.name() => String`](ShallowWrapper/name.md)

packages/enzyme/src/ShallowWrapper.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,9 +852,10 @@ class ShallowWrapper {
852852

853853
/**
854854
* Returns the type of the current node of this wrapper. If it's a composite component, this will
855-
* be the component constructor. If it's a native DOM node, it will be a string.
855+
* be the component constructor. If it's a native DOM node, it will be a string of the tag name.
856+
* If it's null, it will be null.
856857
*
857-
* @returns {String|Function}
858+
* @returns {String|Function|null}
858859
*/
859860
type() {
860861
return this.single('type', typeOfNode);

0 commit comments

Comments
 (0)