Skip to content

Commit

Permalink
Tests for HTML entity encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
developit committed Dec 21, 2015
1 parent f188259 commit cb1cb66
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ describe('render-to-string', () => {

expect(rendered).to.equal(expected);
});

it('should omit functions', () => {
let rendered = render(<div a={()=>{}} b={function(){}} />),
expected = `<div></div>`;

expect(rendered).to.equal(expected);
});

it('should encode entities', () => {
let rendered = render(<div a={'"<>&'}>{'"<>&'}</div>),
expected = `<div a="&quot;&lt;&gt;&amp;">&quot;&lt;&gt;&amp;</div>`;

expect(rendered).to.equal(expected);
});
});

describe('Functional Components', () => {
Expand Down

0 comments on commit cb1cb66

Please sign in to comment.