Files
react/packages/react-dom/src/__tests__/ReactDOMserverIntegrationProgress-test.js
T
Nathan Hunzaker 8d1038fc6d Break up ReactDOMServerIntegrationForm-test (#13600)
In https://github.com/facebook/react/pull/13394, I encountered an
issue where the ReactDOMServerIntegrationForm test suite consumed
sufficient memory to crash CircleCI. Breaking up this test suite by
form element type resolved the issue.

This commit performs that change separate from the Symbol/Function
stringification changes in #13394.
2018-09-08 11:31:32 -07:00

47 lines
1.2 KiB
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @emails react-core
*/
'use strict';
const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegrationTestUtils');
let React;
let ReactDOM;
let ReactDOMServer;
function initModules() {
// Reset warning cache.
jest.resetModuleRegistry();
React = require('react');
ReactDOM = require('react-dom');
ReactDOMServer = require('react-dom/server');
// Make them available to the helpers.
return {
ReactDOM,
ReactDOMServer,
};
}
const {resetModules, itRenders} = ReactDOMServerIntegrationUtils(initModules);
describe('ReactDOMServerIntegrationProgress', () => {
beforeEach(() => {
resetModules();
});
itRenders('a progress in an indeterminate state', async render => {
// Regression test for https://github.com/facebook/react/issues/6119
const e = await render(<progress value={null} />);
expect(e.hasAttribute('value')).toBe(false);
const e2 = await render(<progress value={50} />);
expect(e2.getAttribute('value')).toBe('50');
});
});