ReactTestUtils2

Companion:
class
class Object
trait Matchable
class Any

Type members

Inherited types

type CompType = ComponentRaw { type Raw <: ComponentClassUntyped; }
Inherited from:
ReactTestUtils2
type Unmounted = UnmountedSimple[_, Unit]
Inherited from:
ReactTestUtils2

Value members

Inherited methods

def IsReactActEnvironment(): Boolean
Inherited from:
ReactTestUtils2
def IsReactActEnvironment_=(b: Boolean): Unit
Inherited from:
ReactTestUtils2
def act[A](body: => A): A

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.

Inherited from:
ReactTestUtils2
def actAsync[F[_], A](body: F[A])(implicit F: Async[F]): F[A]

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.

Inherited from:
ReactTestUtils2
def newElement(): Element
Inherited from:
ReactTestUtils2
def removeElement(e: Element): Unit
Inherited from:
ReactTestUtils2
def removeReactInternals(html: String): String

Turn &lt;div data-reactroot=""&gt;hello&lt/div&gt; into &lt;div&gt;hello&lt/div&gt;

Turn &lt;div data-reactroot=""&gt;hello&lt/div&gt; into &lt;div&gt;hello&lt/div&gt;

Inherited from:
ReactTestUtils2
def withRendered[A](unmounted: A): WithDsl[TestDomWithRoot, Renderable[A]]
Inherited from:
ReactTestUtils2

Concrete fields

val raw: ReactTestUtils.type

Inherited fields

val withElement: WithDsl[Element, ImplicitUnit]
Inherited from:
ReactTestUtils2
val withReactRoot: WithDsl[TestReactRoot, ImplicitUnit]
Inherited from:
ReactTestUtils2

Implicits

Inherited implicits

final implicit def reactTestExtMountedImpure[A[_], P, S](m: MountedSimple[Id, A, P, S]): ReactTestExt_MountedSimple[Id, A, P, S]
final implicit def reactTestExtMountedSimple[F[_], A[_], P, S](m: MountedSimple[F, A, P, S]): ReactTestExt_MountedSimple[F, A, P, S]