ReactTestUtils2

japgolly.scalajs.react.test.ReactTestUtils2$
See theReactTestUtils2 companion trait

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Inherited types

type CompType = ComponentRaw { type Raw <: ComponentClassUntyped; }

Attributes

Inherited from:
ReactTestUtils2
type Unmounted = UnmountedSimple[_, Unit]

Attributes

Inherited from:
ReactTestUtils2

Value members

Inherited methods

def IsReactActEnvironment(): Boolean

Attributes

Inherited from:
ReactTestUtils2
def IsReactActEnvironment_=(b: Boolean): Unit

Attributes

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.

Attributes

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.

Attributes

Inherited from:
ReactTestUtils2
def newElement(): Element

Attributes

Inherited from:
ReactTestUtils2
def removeElement(e: Element): Unit

Attributes

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;

Attributes

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

Attributes

Inherited from:
ReactTestUtils2

Concrete fields

val raw: ReactTestUtils.type

Inherited fields

val withElement: WithDsl[Element, ImplicitUnit]

Attributes

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

Attributes

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]

Attributes

Inherited from:
ReactTestUtilExtensions
final implicit def reactTestExtMountedSimple[F[_], A[_], P, S](m: MountedSimple[F, A, P, S]): ReactTestExt_MountedSimple[F, A, P, S]

Attributes

Inherited from:
ReactTestUtilExtensions1