From b5dd140e0911d19b46e5a30b9c54918a785c43af Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Tue, 27 Jun 2017 17:38:29 -0700 Subject: [PATCH] Change expected format for text differences In Stack this is presented as HTML which needs to have normalized escaping rules. In Fiber it is currently not presented as HTML but a raw string so we don't escape it. --- scripts/fiber/tests-passing-except-dev.txt | 1 - scripts/fiber/tests-passing.txt | 1 + .../dom/shared/__tests__/ReactMount-test.js | 15 +++++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/fiber/tests-passing-except-dev.txt b/scripts/fiber/tests-passing-except-dev.txt index 2e553add70ad8..ef19832c00423 100644 --- a/scripts/fiber/tests-passing-except-dev.txt +++ b/scripts/fiber/tests-passing-except-dev.txt @@ -10,4 +10,3 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js src/renderers/dom/shared/__tests__/ReactMount-test.js * should warn if mounting into dirty rendered markup -* should account for escaping on a checksum mismatch diff --git a/scripts/fiber/tests-passing.txt b/scripts/fiber/tests-passing.txt index 1f8e16e3fdb0c..a1be964a4bd82 100644 --- a/scripts/fiber/tests-passing.txt +++ b/scripts/fiber/tests-passing.txt @@ -1567,6 +1567,7 @@ src/renderers/dom/shared/__tests__/ReactMount-test.js * should reuse markup if rendering to the same target twice * should not warn if mounting into non-empty node * should warn when mounting into document.body +* should account for escaping on a checksum mismatch * should warn if render removes React-rendered children * should warn if the unmounted node was rendered by another copy of React * passes the correct callback context diff --git a/src/renderers/dom/shared/__tests__/ReactMount-test.js b/src/renderers/dom/shared/__tests__/ReactMount-test.js index 077070008ae12..25cdc5cf6b5ce 100644 --- a/src/renderers/dom/shared/__tests__/ReactMount-test.js +++ b/src/renderers/dom/shared/__tests__/ReactMount-test.js @@ -194,10 +194,17 @@ describe('ReactMount', () => { div, ); expectDev(console.error.calls.count()).toBe(1); - expectDev(console.error.calls.argsFor(0)[0]).toContain( - ' (client) nbsp entity:   client text\n' + - ' (server) nbsp entity:   server text', - ); + if (ReactDOMFeatureFlags.useFiber) { + expectDev(console.error.calls.argsFor(0)[0]).toContain( + 'Server: "This markup contains an nbsp entity:   server text" ' + + 'Client: "This markup contains an nbsp entity:   client text"', + ); + } else { + expectDev(console.error.calls.argsFor(0)[0]).toContain( + ' (client) nbsp entity:   client text\n' + + ' (server) nbsp entity:   server text', + ); + } }); if (WebComponents !== undefined) {