Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81155 views
1
/**
2
* Copyright 2013-2014, Facebook, Inc.
3
* All rights reserved.
4
*
5
* This source code is licensed under the BSD-style license found in the
6
* LICENSE file in the root directory of this source tree. An additional grant
7
* of patent rights can be found in the PATENTS file in the same directory.
8
*
9
* @emails react-core
10
*/
11
12
"use strict";
13
14
var React;
15
16
describe('ReactTextComponent', function() {
17
beforeEach(function() {
18
React = require('React');
19
});
20
21
it('should escape the rootID', function(){
22
var ThisThingShouldBeEscaped = '">>> LULZ <<<"';
23
var ThisThingWasBeEscaped = '&quot;&gt;&gt;&gt; LULZ &lt;&lt;&lt;&quot;';
24
var thing = <div><span key={ThisThingShouldBeEscaped}>LULZ</span></div>;
25
var html = React.renderToString(thing);
26
expect(html).not.toContain(ThisThingShouldBeEscaped);
27
expect(html).toContain(ThisThingWasBeEscaped);
28
})
29
});
30
31