@samitouri / QOS-React-2 / commits / 0d3fc9de10

Add regression test for #6119

Dan Abramov committed Aug 31, 2018 at 16:09 UTC 0d3fc9de1019fcc69d3be0add555ea47f364059c
1 file changed +9
packages/react-dom/src/__tests__/DOMPropertyOperations-test.js
+9
@@ -139,6 +139,15 @@ describe('DOMPropertyOperations', () => {
139 ReactDOM.render(<progress value="30" />, container);
140 expect(container.firstChild.setAttribute).toHaveBeenCalledTimes(2);
141 });
142 +
143 + it('should return the progress to intermediate state on null value', () => {
144 + const container = document.createElement('div');
145 + ReactDOM.render(<progress value={30} />, container);
146 + ReactDOM.render(<progress value={null} />, container);
147 + // Ensure we move progress back to an indeterminate state.
148 + // Regression test for https://github.com/facebook/react/issues/6119
149 + expect(container.firstChild.hasAttribute('value')).toBe(false);
150 + });
151 });
152
153 describe('deleteValueForProperty', () => {