Skip to content

Commit

Permalink
Add DOM hydrate extra attributes test to fixtures/ssr (facebook#10085)
Browse files Browse the repository at this point in the history
  • Loading branch information
sompylasar committed Jun 9, 2018
1 parent d396122 commit b1851a7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions fixtures/ssr/src/components/SSRMismatchTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class SSRMismatchTest extends Component {
render() {
// Default content rendered at the server.
let content = (
<div>
<div data-ssr-prop-extra>
<em>
SSRMismatchTest default text
</em>
Expand All @@ -17,7 +17,16 @@ export default class SSRMismatchTest extends Component {
if (queryString.indexOf('ssr-prop-mismatch') >= 0) {
// The inner structure is the same as the server render, but the root element has an extra prop.
content = (
<div data-ssr-prop-mismatch>
<div data-ssr-prop-extra data-ssr-prop-mismatch>
<em>
SSRMismatchTest default text
</em>
</div>
);
} else if (queryString.indexOf('ssr-prop-extra') >= 0) {
// The inner structure is the same as the server render, but the root element is missing a server-rendered prop.
content = (
<div>
<em>
SSRMismatchTest default text
</em>
Expand All @@ -26,7 +35,7 @@ export default class SSRMismatchTest extends Component {
} else if (queryString.indexOf('ssr-text-mismatch') >= 0) {
// The inner structure is the same as the server render, but the inner text node content differs.
content = (
<div>
<div data-ssr-prop-extra>
<em>
SSRMismatchTest ssr-text-mismatch
</em>
Expand All @@ -35,7 +44,7 @@ export default class SSRMismatchTest extends Component {
} else if (queryString.indexOf('ssr-children-mismatch') >= 0) {
// The inner structure is different from the server render.
content = (
<div>
<div data-ssr-prop-extra>
SSRMismatchTest ssr-children-mismatch
</div>
);
Expand All @@ -47,6 +56,7 @@ export default class SSRMismatchTest extends Component {
SSRMismatchTest. Open the console, select a test case:{' '}
<a href="/">none</a>{' '}
<a href="/?ssr-prop-mismatch">ssr-prop-mismatch</a>{' '}
<a href="/?ssr-prop-extra">ssr-prop-extra</a>{' '}
<a href="/?ssr-text-mismatch">ssr-text-mismatch</a>{' '}
<a href="/?ssr-children-mismatch">ssr-children-mismatch</a>
</div>
Expand Down

0 comments on commit b1851a7

Please sign in to comment.