Skip to content

Commit

Permalink
Use client-side rendering in tests not specifically about SSR
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gaearon committed Dec 14, 2016
1 parent 05bf2e3 commit caed41b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 0 additions & 4 deletions scripts/fiber/tests-failing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ src/renderers/dom/shared/__tests__/ReactDOM-test.js
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
* should clean up input value tracking
* should clean up input textarea tracking
* gives source code refs for unknown prop warning
* gives source code refs for unknown prop warning for update render
* gives source code refs for unknown prop warning for exact elements
* gives source code refs for unknown prop warning for exact elements in composition

src/renderers/dom/shared/__tests__/ReactDOMTextComponent-test.js
* can reconcile text merged by Node.normalize() alongside other elements
Expand Down
1 change: 0 additions & 1 deletion scripts/fiber/tests-passing-except-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
* gives useful context in warnings
* should warn about incorrect casing on properties (ssr)
* should warn about incorrect casing on event handlers (ssr)
* should warn about class

src/renderers/dom/shared/__tests__/ReactMount-test.js
* should warn if mounting into dirty rendered markup
Expand Down
5 changes: 5 additions & 0 deletions scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,12 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
* should throw when an attack vector is used
* should warn about incorrect casing on properties
* should warn about incorrect casing on event handlers
* should warn about class
* should warn about props that are no longer supported
* gives source code refs for unknown prop warning
* gives source code refs for unknown prop warning for update render
* gives source code refs for unknown prop warning for exact elements
* gives source code refs for unknown prop warning for exact elements in composition
* should suggest property name if available

src/renderers/dom/shared/__tests__/ReactDOMComponentTree-test.js
Expand Down
14 changes: 7 additions & 7 deletions src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ describe('ReactDOMComponent', () => {

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

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

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

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

ReactDOMServer.renderToString(
ReactTestUtils.renderIntoDocument(
<div className="foo1">
<div class="foo2"/>
<div onClick="foo3"/>
Expand Down Expand Up @@ -1550,7 +1550,7 @@ describe('ReactDOMComponent', () => {
}
}

ReactDOMServer.renderToString(<Parent />, container);
ReactTestUtils.renderIntoDocument(<Parent />, container);

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

Expand Down

0 comments on commit caed41b

Please sign in to comment.