Attributes
- Companion
- object
- Deprecated
- true
- Graph
-
- Supertypes
- Known subtypes
-
object ReactTestUtils.type
Members list
Type members
Types
Value members
Concrete methods
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called act() that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called act() that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
act {
// render components
}
// make assertions
This helps make your tests run closer to what real users would experience when using your application.
Attributes
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called act() that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface. React provides a helper called act() that makes sure all updates related to these "units" have been processed and applied to the DOM before you make any assertions:
await act(async () => {
// render components
});
// make assertions
This helps make your tests run closer to what real users would experience when using your application.
Attributes
Traverse all components in tree and accumulate all components where test(component) is true. This is not that useful on its own, but it's used as a primitive for other test utils.
Traverse all components in tree and accumulate all components where test(component) is true. This is not that useful on its own, but it's used as a primitive for other test utils.
Attributes
Same as scryRenderedComponentsWithType but expects there to be one result and returns that one result, or throws exception if there is any other number of matches besides one.
Same as scryRenderedComponentsWithType but expects there to be one result and returns that one result, or throws exception if there is any other number of matches besides one.
Attributes
Like scryRenderedDOMComponentsWithClass but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
Like scryRenderedDOMComponentsWithClass but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
Attributes
Like scryRenderedDOMComponentsWithTag but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
Like scryRenderedDOMComponentsWithTag but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
Attributes
Turn <div data-reactroot="">hello</div>
into <div>hello</div>
Turn <div data-reactroot="">hello</div>
into <div>hello</div>
Attributes
Renders a component into the document body via ReactDOM.render.
Renders a component into the document body via ReactDOM.render.
Unlike ReactTestUtils.renderIntoDocument, this allows DOM focus to work.
Attributes
Render a component into a detached DOM node in the document. This function requires a DOM.
Render a component into a detached DOM node in the document. This function requires a DOM.
Attributes
Finds all instances of components with type equal to componentClass.
Finds all instances of components with type equal to componentClass.
Attributes
Finds all instance of components in the rendered tree that are DOM components with the class name matching className.
Finds all instance of components in the rendered tree that are DOM components with the class name matching className.
Attributes
Finds all instance of components in the rendered tree that are DOM components with the tag name matching tagName.
Finds all instance of components in the rendered tree that are DOM components with the tag name matching tagName.
Attributes
Renders a component then unmounts and cleans up after use.
Renders a component then unmounts and cleans up after use.
Value parameters
- intoBody
-
Whether to use renderIntoBody or ReactTestUtils.renderIntoDocument.
Attributes
Renders a component then unmounts and cleans up after use.
Renders a component then unmounts and cleans up after use.
Value parameters
- intoBody
-
Whether to use renderIntoBodyAsync() or renderIntoDocumentAsync().
Attributes
Renders a component then unmounts and cleans up after use.
Renders a component then unmounts and cleans up after use.
Value parameters
- intoBody
-
Whether to use renderIntoBodyFuture() or renderIntoDocumentFuture().
Attributes
Renders a component into the document body via ReactDOM.render, then unmounts and cleans up after use.
Renders a component into the document body via ReactDOM.render, then unmounts and cleans up after use.
Unlike ReactTestUtils.renderIntoDocument, this allows DOM focus to work.
Attributes
Renders a component into the document body via ReactDOM.render, and asynchronously waits for the Async to complete before unmounting.
Renders a component into the document body via ReactDOM.render, and asynchronously waits for the Async to complete before unmounting.
Attributes
Renders a component into the document body via ReactDOM.render, and asynchronously waits for the Future to complete before unmounting.
Renders a component into the document body via ReactDOM.render, and asynchronously waits for the Future to complete before unmounting.
Attributes
Renders a component into detached DOM via ReactTestUtils.renderIntoDocument, then unmounts and cleans up after use.
Renders a component into detached DOM via ReactTestUtils.renderIntoDocument, then unmounts and cleans up after use.
Attributes
Renders a component into the document body via ReactDOM.render, and asynchronously waits for the Async to complete before unmounting.
Renders a component into the document body via ReactDOM.render, and asynchronously waits for the Async to complete before unmounting.
Attributes
Renders a component into detached DOM via ReactTestUtils.renderIntoDocument, and asynchronously waits for the Future to complete before unmounting.
Renders a component into detached DOM via ReactTestUtils.renderIntoDocument, and asynchronously waits for the Future to complete before unmounting.
Attributes
Implicits
Inherited implicits
Attributes
- Inherited from:
- ReactTestUtilExtensions
Attributes
- Inherited from:
- ReactTestUtilExtensions1