Skip to content

Commit

Permalink
Change expected format for text differences
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebmarkbage committed Jun 28, 2017
1 parent 124b6eb commit b5dd140
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion scripts/fiber/tests-passing-except-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 11 additions & 4 deletions src/renderers/dom/shared/__tests__/ReactMount-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: &nbsp; client text</div>\n' +
' (server) nbsp entity: &nbsp; server text</div>',
);
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: &nbsp; client text</div>\n' +
' (server) nbsp entity: &nbsp; server text</div>',
);
}
});

if (WebComponents !== undefined) {
Expand Down

0 comments on commit b5dd140

Please sign in to comment.