mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix some odd spacing inconsistencies in ReactRenderDocument-test.
This commit is contained in:
committed by
Paul O’Shannessy
parent
59bd45d594
commit
4f57515f91
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user