Fix some odd spacing inconsistencies in ReactRenderDocument-test.

This commit is contained in:
Ben Newman
2014-01-06 21:13:25 -08:00
committed by Paul O’Shannessy
parent 59bd45d594
commit 4f57515f91
2 changed files with 11 additions and 16 deletions
+10 -15
View File
@@ -28,6 +28,13 @@ var getTestDocument;
var testDocument;
var UNMOUNT_INVARIANT_MESSAGE =
'Invariant Violation: ReactFullPageComponenthtml tried to unmount. ' +
'Because of cross-browser quirks it is impossible to unmount some ' +
'top-level components (eg <html>, <head>, and <body>) reliably and ' +
'efficiently. To fix this, have a single top-level component that ' +
'never unmounts render these elements.';
describe('rendering React components at document', function() {
beforeEach(function() {
require('mock-modules').dumpCache();
@@ -92,13 +99,8 @@ describe('rendering React components at document', function() {
expect(function() {
React.unmountComponentAtNode(testDocument);
}).toThrow(
'Invariant Violation: ReactFullPageComponenthtml tried to unmount. ' +
'Because of cross-browser quirks it is impossible to unmount some ' +
'top-level components (eg <html>, <head>, and <body>) reliably ' +
'and efficiently. To fix this, have a single top-level component ' +
'that never unmounts render these elements.'
);
}).toThrow(UNMOUNT_INVARIANT_MESSAGE);
expect(testDocument.body.innerHTML).toBe(' Hello world ');
});
});
@@ -146,17 +148,10 @@ describe('rendering React components at document', function() {
// Reactive update
expect(function() {
React.renderComponent(<Component2 />, testDocument);
}).toThrow(
'Invariant Violation: ReactFullPageComponenthtml tried to unmount. ' +
'Because of cross-browser quirks it is impossible to unmount some ' +
'top-level components (eg <html>, <head>, and <body>) reliably ' +
'and efficiently. To fix this, have a single top-level component ' +
'that never unmounts render these elements.'
);
}).toThrow(UNMOUNT_INVARIANT_MESSAGE);
expect(testDocument.body.innerHTML).toBe(' Hello world ');
});
});
it('should be able to mount into document', function() {
@@ -46,7 +46,7 @@ function createFullPageComponent(componentClass) {
false,
'%s tried to unmount. Because of cross-browser quirks it is ' +
'impossible to unmount some top-level components (eg <html>, <head>, ' +
' and <body>) reliably and efficiently. To fix this, have a single ' +
'and <body>) reliably and efficiently. To fix this, have a single ' +
'top-level component that never unmounts render these elements.',
this.constructor.displayName
);