From 4f57515f918d519bbd7894d88ea606de4ec07884 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Mon, 6 Jan 2014 21:12:32 -0800 Subject: [PATCH] Fix some odd spacing inconsistencies in ReactRenderDocument-test. --- .../__tests__/ReactRenderDocument-test.js | 25 ++++++++----------- src/dom/components/createFullPageComponent.js | 2 +- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/core/__tests__/ReactRenderDocument-test.js b/src/core/__tests__/ReactRenderDocument-test.js index 2c7b6b16ad..350c0356b7 100644 --- a/src/core/__tests__/ReactRenderDocument-test.js +++ b/src/core/__tests__/ReactRenderDocument-test.js @@ -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 , , and ) 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 , , and ) 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(, testDocument); - }).toThrow( - 'Invariant Violation: ReactFullPageComponenthtml tried to unmount. ' + - 'Because of cross-browser quirks it is impossible to unmount some ' + - 'top-level components (eg , , and ) 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() { diff --git a/src/dom/components/createFullPageComponent.js b/src/dom/components/createFullPageComponent.js index 87bebf6fa3..34ebd688c2 100644 --- a/src/dom/components/createFullPageComponent.js +++ b/src/dom/components/createFullPageComponent.js @@ -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 , , ' + - ' and ) reliably and efficiently. To fix this, have a single ' + + 'and ) reliably and efficiently. To fix this, have a single ' + 'top-level component that never unmounts render these elements.', this.constructor.displayName );