Skip to content

Commit

Permalink
extend escaped test #1430
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Dec 14, 2021
1 parent 6fda214 commit 71d3542
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ i18n.init({
transTest3: 'Result should be a clickable link <0 href="https://www.google.com">Google</0>',
transTest3_overwrite:
'Result should be a clickable link <0 href="https://www.google.com">Google</0>',
transTestEscapedHtml: 'Escaped html should unescape correctly <0>&lt;&amp;&gt;</0>.',
transTestEscapedHtml: 'Escaped html should unescape correctly <0>&lt;&nbsp;&amp;&gt;</0>.',
},
other: {
transTest1: 'Another go <1>there</1>.',
Expand Down
4 changes: 2 additions & 2 deletions test/trans.render.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,15 +628,15 @@ describe('trans should allow escaped html', () => {
<Trans i18nKey="transTestEscapedHtml" components={[<Link to="/msgs" />]} shouldUnescape />
);

it('should unescape &lt; &amp; &gt; to < & >', () => {
it('should unescape &lt; &nbsp; &amp; &gt; to < SPACE & >', () => {
const { container } = render(<TestComponent />);
expect(container.firstChild).toMatchInlineSnapshot(`
<div>
Escaped html should unescape correctly
<a
href="/msgs"
>
&lt;&&gt;
&lt;&nbsp;&&gt;
</a>
.
</div>
Expand Down

0 comments on commit 71d3542

Please sign in to comment.