Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] add link to Cheerio API and another example #756

Merged
merged 1 commit into from Feb 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/api/render.md
Expand Up @@ -10,7 +10,7 @@ disservice.

For the purposes of this documentation, we will refer to Cheerio's constructor as
`CheerioWrapper`, which is to say that it is analogous to our `ReactWrapper` and `ShallowWrapper`
constructors.
constructors. You can reference the [Cheerio API docs](https://github.com/cheeriojs/cheerio#api) for methods available on a `CheerioWrapper` instance.

### Example Usage

Expand All @@ -30,6 +30,11 @@ describe('<Foo />', () => {
expect(wrapper.text()).to.contain('unique');
});

it('renders a div', () => {
const wrapper = render(<div className="myClass" />);
expect(wrapper.html()).to.contain('div');
});

it('can pass in context', () => {
function SimpleComponent(props, context) {
const { name } = context;
Expand Down