Use a test case that demonstrates the fix.

This commit is contained in:
Eric O'Connell 2015-07-09 14:56:55 -07:00
parent 902b607f1f
commit 0941cc9884
1 changed files with 6 additions and 4 deletions

View File

@ -159,16 +159,18 @@ describe('ReactMount', function() {
it('should account for escaping on a checksum mismatch', function () {
var div = document.createElement('div');
var markup = React.renderToString(
<div>This markup contains an html entity: &amp; server text</div>);
<div>This markup contains an nbsp entity: &nbsp; server text</div>);
div.innerHTML = markup;
spyOn(console, 'error');
React.render(
<div>This markup contains an html entity: &amp; client text</div>, div);
<div>This markup contains an nbsp entity: &nbsp; client text</div>,
div
);
expect(console.error.calls.length).toBe(1);
expect(console.error.calls[0].args[0]).toContain(
' (client) html entity: &amp; client text</div>\n' +
' (server) html entity: &amp; server text</div>'
' (client) nbsp entity: &nbsp; client text</div>\n' +
' (server) nbsp entity: &nbsp; server text</div>'
);
});