@samitouri / QOS-React-2 / commits / 3cdf718504

Use the public render API in ReactDOMComponent-test

Avoids testing a non-public API. First step towards refactoring more of these internals to not be instances. Also gets rid of an _owner usage.

Sebastian Markbage committed Jun 10, 2015 at 17:34 UTC 3cdf71850476933ae03daec1c1f4b9c14d6a7eea
1 file changed +2 -16
src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
+2 -16
@@ -445,24 +445,10 @@ describe('ReactDOMComponent', function() {
445 require('mock-modules').dumpCache();
446
447 React = require('React');
448 - var ReactMultiChild = require('ReactMultiChild');
449 - var ReactDOMComponent = require('ReactDOMComponent');
450 - var ReactReconcileTransaction = require('ReactReconcileTransaction');
451 -
452 - var StubNativeComponent = function(element) {
453 - this._currentElement = element;
454 - };
455 - assign(StubNativeComponent.prototype, ReactDOMComponent.Mixin);
456 - assign(StubNativeComponent.prototype, ReactMultiChild.Mixin);
448
449 mountComponent = function(props) {
459 - var transaction = new ReactReconcileTransaction();
460 - var stubComponent = new StubNativeComponent({
461 - type: StubNativeComponent,
462 - props: props,
463 - _owner: null,
464 - });
465 - return stubComponent.mountComponent('test', transaction, {});
450 + var container = document.createElement('div');
451 + React.render(<div {...props} />, container);
452 };
453 });
454