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

Added render and html methods for ShallowWrapper #20

Merged
merged 1 commit into from Nov 16, 2015

Conversation

lelandrichardson
Copy link
Collaborator

This PR adds a .render() and a .html() method to the ShallowWrapper prototype. These are mainly convenience methods and allow the user to fluidly switch between shallow rendering and static rendering for pieces of the tree, which can actually be quite useful if you want to assert something HTML related, but you also want to use the shallow API to set state and simulate events and other things that the static renderer cannot do.

Related Issues: #11 and #2

@lelandrichardson lelandrichardson force-pushed the lmr/render-and-html-methods-for-shallow branch from 96e216f to 21a28da Compare November 16, 2015 02:36
@@ -0,0 +1,40 @@
# `.render() => CheerioWrapper`

Returns a CheerioWrapper around the rendered HTML of the current node's subtree.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I can do import { render } from 'reagent', I'd expect foo.render() to be a convenience method for render(foo.get(0)). Is this what it's doing? (the full render docs don't exist yet)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is effectively what it's doing.

@ljharb
Copy link
Member

ljharb commented Nov 16, 2015

LGTM

@lelandrichardson lelandrichardson force-pushed the lmr/render-and-html-methods-for-shallow branch from 21a28da to 18196e1 Compare November 16, 2015 20:42
lelandrichardson added a commit that referenced this pull request Nov 16, 2015
…allow

Added render and html methods for ShallowWrapper
@lelandrichardson lelandrichardson merged commit 8aa5d5b into master Nov 16, 2015
@lelandrichardson lelandrichardson deleted the lmr/render-and-html-methods-for-shallow branch November 16, 2015 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants