Skip to content

Commit caed41b

Browse files
committed
Use client-side rendering in tests not specifically about SSR
It looks like the usage of renderToString() is a copypasta that spread from a test above which was specifically about SSR. I am changing the tests about non-SSR specific warnings to run on the client so we can better track them with Fiber.
1 parent 05bf2e3 commit caed41b

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

scripts/fiber/tests-failing.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ src/renderers/dom/shared/__tests__/ReactDOM-test.js
2222
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
2323
* should clean up input value tracking
2424
* should clean up input textarea tracking
25-
* gives source code refs for unknown prop warning
26-
* gives source code refs for unknown prop warning for update render
27-
* gives source code refs for unknown prop warning for exact elements
28-
* gives source code refs for unknown prop warning for exact elements in composition
2925

3026
src/renderers/dom/shared/__tests__/ReactDOMTextComponent-test.js
3127
* can reconcile text merged by Node.normalize() alongside other elements

scripts/fiber/tests-passing-except-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
99
* gives useful context in warnings
1010
* should warn about incorrect casing on properties (ssr)
1111
* should warn about incorrect casing on event handlers (ssr)
12-
* should warn about class
1312

1413
src/renderers/dom/shared/__tests__/ReactMount-test.js
1514
* should warn if mounting into dirty rendered markup

scripts/fiber/tests-passing.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,12 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
692692
* should throw when an attack vector is used
693693
* should warn about incorrect casing on properties
694694
* should warn about incorrect casing on event handlers
695+
* should warn about class
695696
* should warn about props that are no longer supported
697+
* gives source code refs for unknown prop warning
698+
* gives source code refs for unknown prop warning for update render
699+
* gives source code refs for unknown prop warning for exact elements
700+
* gives source code refs for unknown prop warning for exact elements in composition
696701
* should suggest property name if available
697702

698703
src/renderers/dom/shared/__tests__/ReactDOMComponentTree-test.js

src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ describe('ReactDOMComponent', () => {
14361436

14371437
it('should warn about class', () => {
14381438
spyOn(console, 'error');
1439-
ReactDOMServer.renderToString(React.createElement('div', {class: 'muffins'}));
1439+
ReactTestUtils.renderIntoDocument(React.createElement('div', {class: 'muffins'}));
14401440
expectDev(console.error.calls.count()).toBe(1);
14411441
expectDev(console.error.calls.argsFor(0)[0]).toContain('className');
14421442
});
@@ -1455,8 +1455,8 @@ describe('ReactDOMComponent', () => {
14551455

14561456
it('gives source code refs for unknown prop warning', () => {
14571457
spyOn(console, 'error');
1458-
ReactDOMServer.renderToString(<div class="paladin"/>);
1459-
ReactDOMServer.renderToString(<input type="text" onclick="1"/>);
1458+
ReactTestUtils.renderIntoDocument(<div class="paladin"/>);
1459+
ReactTestUtils.renderIntoDocument(<input type="text" onclick="1"/>);
14601460
expectDev(console.error.calls.count()).toBe(2);
14611461
expect(
14621462
normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])
@@ -1475,10 +1475,10 @@ describe('ReactDOMComponent', () => {
14751475
spyOn(console, 'error');
14761476
var container = document.createElement('div');
14771477

1478-
ReactDOMServer.renderToString(<div className="paladin" />, container);
1478+
ReactTestUtils.renderIntoDocument(<div className="paladin" />, container);
14791479
expectDev(console.error.calls.count()).toBe(0);
14801480

1481-
ReactDOMServer.renderToString(<div class="paladin" />, container);
1481+
ReactTestUtils.renderIntoDocument(<div class="paladin" />, container);
14821482
expectDev(console.error.calls.count()).toBe(1);
14831483
expect(
14841484
normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])
@@ -1491,7 +1491,7 @@ describe('ReactDOMComponent', () => {
14911491
it('gives source code refs for unknown prop warning for exact elements ', () => {
14921492
spyOn(console, 'error');
14931493

1494-
ReactDOMServer.renderToString(
1494+
ReactTestUtils.renderIntoDocument(
14951495
<div className="foo1">
14961496
<div class="foo2"/>
14971497
<div onClick="foo3"/>
@@ -1550,7 +1550,7 @@ describe('ReactDOMComponent', () => {
15501550
}
15511551
}
15521552

1553-
ReactDOMServer.renderToString(<Parent />, container);
1553+
ReactTestUtils.renderIntoDocument(<Parent />, container);
15541554

15551555
expectDev(console.error.calls.count()).toBe(2);
15561556

0 commit comments

Comments
 (0)