@samitouri / QOS-React / commits / e17cc98a89

Removed redundant gCC test

Brian Vaughn committed Jan 10, 2017 at 14:03 UTC e17cc98a898f0e92e1f8a709820b9c82ea8a1965
2 files changed +25 -44
scripts/fiber/tests-passing.txt
-1
@@ -159,7 +159,6 @@ src/isomorphic/classic/__tests__/ReactContextValidator-test.js
159 * should check child context types
160 * should warn (but not error) if getChildContext method is missing
161 * should pass parent context if getChildContext method is missing
162 -* should only warn about missing getChildContext once per component type
162
163 src/isomorphic/classic/class/__tests__/ReactBind-test.js
164 * Holds reference to instance
src/isomorphic/classic/__tests__/ReactContextValidator-test.js
+25 -43
@@ -294,20 +294,36 @@ describe('ReactContextValidator', () => {
294 it('should warn (but not error) if getChildContext method is missing', () => {
295 spyOn(console, 'error');
296
297 - var MyComponent = React.createClass({
298 - childContextTypes: {
297 + class ComponentA extends React.Component {
298 + static childContextTypes = {
299 foo: React.PropTypes.string.isRequired,
300 - },
301 -
302 - render: function() {
300 + };
301 + render() {
302 return <div />;
304 - },
305 - });
303 + }
304 + }
305 + class ComponentB extends React.Component {
306 + static childContextTypes = {
307 + foo: React.PropTypes.string.isRequired,
308 + };
309 + render() {
310 + return <div />;
311 + }
312 + }
313
307 - ReactTestUtils.renderIntoDocument(<MyComponent/>);
314 + ReactTestUtils.renderIntoDocument(<ComponentA/>);
315 expectDev(console.error.calls.count()).toBe(1);
316 expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe(
310 - 'Warning: getChildContext() is not defined for MyComponent'
317 + 'Warning: getChildContext() is not defined for ComponentA'
318 + );
319 +
320 + // Warnings should be deduped by component type
321 + ReactTestUtils.renderIntoDocument(<ComponentA/>);
322 + expectDev(console.error.calls.count()).toBe(1);
323 + ReactTestUtils.renderIntoDocument(<ComponentB/>);
324 + expectDev(console.error.calls.count()).toBe(2);
325 + expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(1)[0])).toBe(
326 + 'Warning: getChildContext() is not defined for ComponentB'
327 );
328 });
329
@@ -356,38 +372,4 @@ describe('ReactContextValidator', () => {
372 expect(childContext.foo).toBe('FOO');
373 });
374
359 - it('should only warn about missing getChildContext once per component type', () => {
360 - spyOn(console, 'error');
361 -
362 - class ComponentA extends React.Component {
363 - static childContextTypes = {
364 - foo: React.PropTypes.string.isRequired,
365 - };
366 - render() {
367 - return <div />;
368 - }
369 - }
370 - class ComponentB extends React.Component {
371 - static childContextTypes = {
372 - foo: React.PropTypes.string.isRequired,
373 - };
374 - render() {
375 - return <div />;
376 - }
377 - }
378 -
379 - ReactTestUtils.renderIntoDocument(<ComponentA/>);
380 - expectDev(console.error.calls.count()).toBe(1);
381 - expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(0)[0])).toBe(
382 - 'Warning: getChildContext() is not defined for ComponentA'
383 - );
384 - ReactTestUtils.renderIntoDocument(<ComponentA/>);
385 - expectDev(console.error.calls.count()).toBe(1);
386 - ReactTestUtils.renderIntoDocument(<ComponentB/>);
387 - expectDev(console.error.calls.count()).toBe(2);
388 - expectDev(normalizeCodeLocInfo(console.error.calls.argsFor(1)[0])).toBe(
389 - 'Warning: getChildContext() is not defined for ComponentB'
390 - );
391 - });
392 -
375 });