diff --git a/scripts/fiber/tests-failing.txt b/scripts/fiber/tests-failing.txt index 67febc8fb363a..36eaf9ae75cb1 100644 --- a/scripts/fiber/tests-failing.txt +++ b/scripts/fiber/tests-failing.txt @@ -23,8 +23,6 @@ src/renderers/__tests__/refs-test.js * Should increase refs with an increase in divs 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 (ssr) * gives source code refs for unknown prop warning for exact elements (ssr) * gives source code refs for unknown prop warning for exact elements in composition (ssr) diff --git a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js index e9bf9a0823c5b..4d031112e10d4 100644 --- a/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js +++ b/src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js @@ -16,9 +16,9 @@ describe('ReactDOMComponent', () => { var React; var ReactTestUtils; var ReactDOM; - var ReactDOMFeatureFlags; var ReactDOMServer; var inputValueTracking; + var ReactDOMFeatureFlags = require('ReactDOMFeatureFlags'); function normalizeCodeLocInfo(str) { return str && str.replace(/\(at .+?:\d+\)/g, '(at **)'); @@ -1206,29 +1206,32 @@ describe('ReactDOMComponent', () => { }); describe('unmountComponent', () => { - it('should clean up input value tracking', () => { - var container = document.createElement('div'); - var node = ReactDOM.render(, container); - var tracker = inputValueTracking._getTrackerFromNode(node); + // Fiber does not have a clean-up phase for host components; relies on GC + if (!ReactDOMFeatureFlags.useFiber) { + it('should clean up input value tracking', () => { + var container = document.createElement('div'); + var node = ReactDOM.render(, container); + var tracker = inputValueTracking._getTrackerFromNode(node); - spyOn(tracker, 'stopTracking'); + spyOn(tracker, 'stopTracking'); - ReactDOM.unmountComponentAtNode(container); + ReactDOM.unmountComponentAtNode(container); - expect(tracker.stopTracking.calls.count()).toBe(1); - }); + expect(tracker.stopTracking.calls.count()).toBe(1); + }); - it('should clean up input textarea tracking', () => { - var container = document.createElement('div'); - var node = ReactDOM.render(