Skip to content

Commit

Permalink
Add a regression test with namespace nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Oct 5, 2017
1 parent be96bb9 commit 850550c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/renderers/dom/shared/__tests__/ReactServerRendering-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,4 +701,27 @@ describe('ReactDOMServer', () => {
'tabindex=',
);
});

it('keeps tracks of attribute case sensitivity based on the namespace', () => {
const html = ReactDOMServer.renderToString(
<div itemProp="name">
<svg textRendering="optimizeLegibility" baseProfile="full">
<foreignObject externalResourcesRequired={true} tabIndex="1">
<img srcSet="wow" />
<svg viewBox="0 0 0 0" />
</foreignObject>
</svg>
<input minLength="10" />
</div>,
);
// SVG is case sensitive
expect(html).toContain('text-rendering=');
expect(html).toContain('baseProfile=');
expect(html).toContain('tabindex=');
expect(html).toContain('viewBox=');
// HTML is not, but people expect lowercase output
expect(html).toContain('itemprop=');
expect(html).toContain('srcset=');
expect(html).toContain('minlength=');
});
});

0 comments on commit 850550c

Please sign in to comment.