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

Fix ReactRenderDocument tests #338

Merged
merged 1 commit into from
Sep 11, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions src/core/__tests__/ReactRenderDocument-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ describe('rendering React components at document', function() {
testDocument = getTestDocument();
});

if (!testDocument) {
// These tests are not applicable in jst, since jsdom is buggy.
return;
}

it('should be able to switch root constructors via state', function() {
if (!testDocument) {
// These tests are not applicable in jst, since jsdom is buggy.
return;
}

var Component = React.createClass({
render: function() {
return (
Expand Down Expand Up @@ -100,6 +100,11 @@ describe('rendering React components at document', function() {
});

it('should be able to switch root constructors', function() {
if (!testDocument) {
// These tests are not applicable in jst, since jsdom is buggy.
return;
}

var Component = React.createClass({
render: function() {
return (
Expand Down Expand Up @@ -143,6 +148,11 @@ describe('rendering React components at document', function() {
});

it('should be able to mount into document', function() {
if (!testDocument) {
// These tests are not applicable in jst, since jsdom is buggy.
return;
}

var Component = React.createClass({
render: function() {
return (
Expand All @@ -164,6 +174,11 @@ describe('rendering React components at document', function() {
});

it('should throw on full document render', function() {
if (!testDocument) {
// These tests are not applicable in jst, since jsdom is buggy.
return;
}

var container = testDocument;
expect(function() {
React.renderComponent(<html />, container);
Expand All @@ -178,6 +193,11 @@ describe('rendering React components at document', function() {
});

it('should throw on full document render of non-html', function() {
if (!testDocument) {
// These tests are not applicable in jst, since jsdom is buggy.
return;
}

var container = testDocument;
ReactMount.allowFullPageRender = true;
expect(function() {
Expand Down