Skip to content

Commit

Permalink
Add example to contains() docs with an embedded expression
Browse files Browse the repository at this point in the history
  • Loading branch information
willj authored and ljharb committed Dec 13, 2017
1 parent 2617377 commit 2acab0e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/api/ShallowWrapper/contains.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ expect(wrapper.contains([
])).to.equal(false);
```

```jsx
const calculatedValue = 2 + 2;

const wrapper = shallow((
<div>
<div data-foo="foo" data-bar="bar">{calculatedValue}</div>
</div>
));

expect(wrapper.contains(<div data-foo="foo" data-bar="bar">{4}</div>)).to.equal(true);
```

#### Common Gotchas

Expand Down

0 comments on commit 2acab0e

Please sign in to comment.