japgolly.scalajs.react.test

Type members

Classlikes

class MockRouterCtl[P](baseUrl: BaseUrl, pageToPath: P => Path) extends MockRouterCtlF[Sync, P]

Mock RouterCtl that does nothing but record events.

Mock RouterCtl that does nothing but record events.

Call events to inspect recorded events, and clear to clear them.

Companion:
object
Companion:
class
class MockRouterCtlF[F[_], P](val baseUrl: BaseUrl, pageToPath: P => Path)(implicit ff: Sync[F]) extends RouterCtlF[F, P]

Mock RouterCtl that does nothing but record events.

Mock RouterCtl that does nothing but record events.

Call events to inspect recorded events, and clear to clear them.

Companion:
object
Companion:
class
sealed abstract class ReactEventType
Companion:
object
Companion:
class
Companion:
class
object ReactTestUtilsConfig extends ReactTestUtilsConfigTypes
class ReactTestVarF[F[_], A](val initialValue: A)(implicit val sync: Sync[F])

Houses a variable and provides React-like access to it.

Houses a variable and provides React-like access to it.

Provides mock-like instances of the following:

  • Reusable functions
  • StateAccess
  • StateSnapshot
  • StateSnapshot with Reusability

It also keeps a log of changes, accessible via .history().

Type parameters:
A

The variable type.

Since:

0.11.0

Companion:
object
Companion:
class
object SimEvent
object Simulate

https://reactjs.org/docs/test-utils.html#simulate

class Simulation(_run: () => ReactOrDomNode => Unit)

Allows composition and abstraction of ReactTestUtils.Simulate procedures.

Allows composition and abstraction of ReactTestUtils.Simulate procedures.

Companion:
object
object Simulation
Companion:
class
class TestBroadcaster[I, A](initialValue: A, f: I => A) extends TestBroadcasterF[Sync, I, A] with Broadcaster[I]
Companion:
object
Companion:
class
abstract class TestBroadcasterF[F[_], I, A](initialValue: A, f: I => A) extends BroadcasterF[F, I]
Companion:
class
trait TestContainer extends TestDom

Wraps a DOM container and provides utilities for testing its state.

Wraps a DOM container and provides utilities for testing its state.

As an example `testContainer.innerHTML.assert("

Welcome")`

Since:

2.2.0

Companion:
object
object TestDom
Companion:
class
trait TestDom

Wraps a DOM and provides utilities for testing its state.

Wraps a DOM and provides utilities for testing its state.

As an example `testDom.outerHTML.assert("

Welcome")`

Since:

2.2.0

Companion:
object
Companion:
class
trait TestDomWithRoot extends TestDom
Companion:
object
Companion:
class

Wraps a React Root (introduced in React 18) and provides utilities for testing its state.

Wraps a React Root (introduced in React 18) and provides utilities for testing its state.

As an example `testRoot.innerHTML.assert("

Welcome")`

Since:

2.2.0 / React 18

Companion:
object

Deprecated classlikes

@deprecated("Migrate to React 18 and ReactTestUtils2. This will be replaced by ReactTestUtils2 in scalajs-react 3.0.0.", "2.2.0 / React 18")
Companion:
class
Deprecated
@deprecated("Migrate to React 18 and ReactTestUtils2. This will be replaced by ReactTestUtils2 in scalajs-react 3.0.0.", "2.2.0 / React 18")
Companion:
object
Deprecated

Types

type ReactOrDomNode = ReactOrDomNode
type ReactTestVar[A] = ReactTestVarF[Sync, A]

Implicits

Implicits

implicit def reactOrDomNodeFromMounted(m: MountedRaw): ReactOrDomNode
implicit def reactOrDomNodeFromVRE(m: VdomElement): ReactOrDomNode

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]