Skip to content

Commit

Permalink
[Docs] Added missing isEmptyRender() docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles Johnson authored and ljharb committed Jun 1, 2017
1 parent f16f0b8 commit 80a74b4
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
18 changes: 18 additions & 0 deletions docs/api/ReactWrapper/isEmptyRender.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# `.isEmptyRender() => Boolean`

Returns whether or not the current component returns a falsy value: `false`, `null`, `undefined`.

#### Returns

`Boolean`: whether the return is falsy

#### Example

```jsx
function Foo() {
return null;
}

const wrapper = mount(<Foo />);
expect(wrapper.isEmptyRender()).to.be(true);
```
18 changes: 18 additions & 0 deletions docs/api/ShallowWrapper/isEmptyRender.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# `.isEmptyRender() => Boolean`

Returns whether or not the current component returns a falsy value: `false`, `null`, `undefined`.

#### Returns

`Boolean`: whether the return is falsy

#### Example

```jsx
function Foo() {
return null;
}

const wrapper = shallow(<Foo />);
expect(wrapper.isEmptyRender()).to.be(true);
```
3 changes: 3 additions & 0 deletions docs/api/mount.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ Returns whether or not the current node exists.
#### [`.isEmpty() => Boolean`](ReactWrapper/isEmpty.md)
*Deprecated*: Use [.exists()](ReactWrapper/exists.md) instead.

#### [`.isEmptyRender() => Boolean`](ReactWrapper/isEmptyRender.md)
Returns whether or not the current component returns a falsy value.

#### [`.not(selector) => ReactWrapper`](ReactWrapper/not.md)
Remove nodes in the current wrapper that match the provided selector. (inverse of `.filter()`)

Expand Down
3 changes: 3 additions & 0 deletions docs/api/shallow.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ Returns whether or not the current node exists.
#### [`.isEmpty() => Boolean`](ShallowWrapper/isEmpty.md)
*Deprecated*: Use [.exists()](ShallowWrapper/exists.md) instead.

#### [`.isEmptyRender() => Boolean`](ShallowWrapper/isEmptyRender.md)
Returns whether or not the current component returns a falsy value.

#### [`.not(selector) => ShallowWrapper`](ShallowWrapper/not.md)
Remove nodes in the current wrapper that match the provided selector. (inverse of `.filter()`)

Expand Down
2 changes: 1 addition & 1 deletion test/ShallowTraversal-spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ describe('ShallowTraversal', () => {
</div>
);

it('should return an empty array for falsey test', () => {
it('should return an empty array for falsy test', () => {
expect(treeFilter(tree, () => false).length).to.equal(0);
});

Expand Down

0 comments on commit 80a74b4

Please sign in to comment.