RenderResult class Queries
The model returned from render, which includes all the ScopedQueries
scoped to the
container that the renderedElement was rendered within.
See: testing-library.com/docs/react-testing-library/api/#render-result
- Annotations
-
- @sealed
Properties
- baseElement → Node
-
The containing DOM node where your
ReactElement
is rendered in the container.no setter - container → Node
-
The containing DOM node of your rendered
ReactElement
(via render).no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- renderedElement → ReactElement
-
The rendered VDOM instance (
ReactElement
) that was passed to render as the first argument.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
asFragment(
) → DocumentFragment -
Returns a
DocumentFragment
of your renderedElement. -
debug(
[Node? baseElement, int? maxLength, PrettyDomOptions? options]) → void -
A shortcut to print
prettyDOM(baseElement)
. -
findAllByAltText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< List< E> > -
Returns a list of ImageElements, InputElements and/or AreaElements with the given
text
as the value of thealt
attribute, defaulting to anexact
match after waiting1000ms
(or the specifiedtimeout
duration).inherited -
findAllByDisplayValue<
E extends Element> (dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< List< E> > -
Returns a list of InputElement, TextAreaElement or SelectElement that has the matching
value
displayed, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findAllByLabelText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< List< E> > -
Returns a list of elements that are associated with a LabelElement with the given
text
, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findAllByPlaceholderText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< List< E> > -
Returns a list of elements with the given
text
as the value of theplaceholder
attribute, defaulting to anexact
match after waiting1000ms
(or the specifiedtimeout
duration).inherited -
findAllByRole<
E extends Element> (dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< List< E> > -
Returns a list of elements with the given
role
value, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findAllByTestId<
E extends Element> (dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< List< E> > -
Returns a list of elements with the given
testId
value for thedata-test-id
attribute, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findAllByText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script', Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< List< E> > -
Returns a list of elements with the given
text
content, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findAllByTitle<
E extends Element> (dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< List< E> > -
Returns a list of elements with the given
title
as the value of thetitle
attribute, defaulting to anexact
match after waiting1000ms
(or the specifiedtimeout
duration).inherited -
findByAltText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< E> -
Returns a future with a single ImageElement, InputElement or AreaElement value with the given
text
as the value of thealt
attribute, defaulting to anexact
match after waiting1000ms
(or the specifiedtimeout
duration).inherited -
findByDisplayValue<
E extends Element> (dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< E> -
Returns a future with a single InputElement, TextAreaElement or SelectElement that has the matching
value
displayed, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findByLabelText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< E> -
Returns a future with a single element that is associated with a LabelElement with the given
text
, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findByPlaceholderText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< E> -
Returns a future with a single element value with the given
text
as the value of theplaceholder
attribute, defaulting to anexact
match after waiting1000ms
(or the specifiedtimeout
duration).inherited -
findByRole<
E extends Element> (dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< E> -
Returns a future with a single element value with the given
role
value, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findByTestId<
E extends Element> (dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< E> -
Returns a future with a single element value with the given
testId
value for thedata-test-id
attribute, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findByText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script', Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< E> -
Returns a future with a single element value with the given
text
content, defaulting to anexact
match after waiting 1000ms (or the providedtimeout
duration).inherited -
findByTitle<
E extends Element> (dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, Duration? timeout, Duration interval = defaultAsyncCallbackCheckInterval, QueryTimeoutFn? onTimeout, MutationObserverOptions mutationObserverOptions = defaultMutationObserverOptions}) → Future< E> -
Returns a future with a single element value with the given
title
as the value of thetitle
attribute, defaulting to anexact
match after waiting1000ms
(or the specifiedtimeout
duration).inherited -
getAllByAltText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of ImageElements, InputElements and/or AreaElements with the given
text
as the value of thealt
attribute, defaulting to anexact
match.inherited -
getAllByDisplayValue<
E extends Element> (dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of InputElements, TextAreaElements or SelectElements that have the matching
value
displayed, defaulting to anexact
match.inherited -
getAllByLabelText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector}) → List< E> -
Returns a list of elements that are associated with a LabelElement with the given
text
, defaulting to anexact
match.inherited -
getAllByPlaceholderText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of elements with the given
text
as the value of theplaceholder
attribute, defaulting to anexact
match.inherited -
getAllByRole<
E extends Element> (dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level}) → List< E> -
Returns a list of elements with the given
role
value, defaulting to anexact
match.inherited -
getAllByTestId<
E extends Element> (dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of elements with the given
testId
value for thedata-test-id
attribute, defaulting to anexact
match.inherited -
getAllByText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script'}) → List< E> -
Returns a list of elements with the given
text
content, defaulting to anexact
match.inherited -
getAllByTitle<
E extends Element> (dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of elements with the given
title
as the value of thetitle
attribute, defaulting to anexact
match.inherited -
getByAltText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E -
Returns a single ImageElement, InputElement or AreaElement with the given
text
as the value of thealt
attribute, defaulting to anexact
match.inherited -
getByDisplayValue<
E extends Element> (dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E -
Returns a single InputElement, TextAreaElement or SelectElement that has the matching
value
displayed, defaulting to anexact
match.inherited -
getByLabelText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector}) → E -
Returns a single element that is associated with a LabelElement with the given
text
, defaulting to anexact
match.inherited -
getByPlaceholderText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E -
Returns a single element with the given
text
as the value of theplaceholder
attribute, defaulting to anexact
match.inherited -
getByRole<
E extends Element> (dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level}) → E -
Returns a single element with the given
role
value, defaulting to anexact
match.inherited -
getByTestId<
E extends Element> (dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E -
Returns a single element with the given
testId
value for thedata-test-id
attribute, defaulting to anexact
match.inherited -
getByText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script'}) → E -
Returns a single element with the given
text
content, defaulting to anexact
match.inherited -
getByTitle<
E extends Element> (dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E -
Returns a single element with the given
title
as the value of thetitle
attribute, defaulting to anexact
match.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queryAllByAltText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of ImageElements, InputElements and/or AreaElements with the given
text
as the value of thealt
attribute, defaulting to anexact
match.inherited -
queryAllByDisplayValue<
E extends Element> (dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of InputElements, TextAreaElements or SelectElements that have the matching
value
displayed, defaulting to anexact
match.inherited -
queryAllByLabelText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector}) → List< E> -
Returns a list of elements that are associated with a LabelElement with the given
text
, defaulting to anexact
match.inherited -
queryAllByPlaceholderText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of elements with the given
text
as the value of theplaceholder
attribute, defaulting to anexact
match.inherited -
queryAllByRole<
E extends Element> (dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level}) → List< E> -
Returns a list of elements with the given
role
value, defaulting to anexact
match.inherited -
queryAllByTestId<
E extends Element> (dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of elements with the given
testId
value for thedata-test-id
attribute, defaulting to anexact
match.inherited -
queryAllByText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script'}) → List< E> -
Returns a list of elements with the given
text
content, defaulting to anexact
match.inherited -
queryAllByTitle<
E extends Element> (dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → List< E> -
Returns a list of elements with the given
title
as the value of thetitle
attribute, defaulting to anexact
match.inherited -
queryByAltText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? -
Returns a single ImageElement, InputElement or AreaElement with the given
text
as the value of thealt
attribute, defaulting to anexact
match.inherited -
queryByDisplayValue<
E extends Element> (dynamic value, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? -
Returns a single InputElement, TextAreaElement or SelectElement that has the matching
value
displayed, defaulting to anexact
match.inherited -
queryByLabelText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector}) → E? -
Returns a single element that is associated with a LabelElement with the given
text
, defaulting to anexact
match.inherited -
queryByPlaceholderText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? -
Returns a single element with the given
text
as the value of theplaceholder
attribute, defaulting to anexact
match.inherited -
queryByRole<
E extends Element> (dynamic role, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, dynamic name, bool? selected, bool? checked, bool? pressed, bool? expanded, bool queryFallbacks = false, int? level}) → E? -
Returns a single element with the given
role
value, defaulting to anexact
match.inherited -
queryByTestId<
E extends Element?> (dynamic testId, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? -
Returns a single element with the given
testId
value for thedata-test-id
attribute, defaulting to anexact
match.inherited -
queryByText<
E extends Element> (dynamic text, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?, String? selector, dynamic ignore = 'script'}) → E? -
Returns a single element with the given
text
content, defaulting to anexact
match.inherited -
queryByTitle<
E extends Element> (dynamic title, {bool exact = true, NormalizerFn normalizer([NormalizerOptions?])?}) → E? -
Returns a single element with the given
title
as the value of thetitle
attribute, defaulting to anexact
match.inherited -
rerender(
ReactElement ui) → void -
Updates the props of the renderedElement by providing an updated
ui
element. -
toString(
) → String -
A string representation of this object.
inherited
-
unmount(
) → void - Unmounts the renderedElement.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited