ReactTestUtils2

Companion:
object
class Object
trait Matchable
class Any
object ReactTestUtils2.type

Type members

Types

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

Value members

Concrete methods

def IsReactActEnvironment(): Boolean
def IsReactActEnvironment_=(b: Boolean): Unit
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.

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.

def newElement(): Element
def removeElement(e: Element): Unit
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;

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

Concrete fields

val withElement: WithDsl[Element, ImplicitUnit]
val withReactRoot: WithDsl[TestReactRoot, ImplicitUnit]

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]