TestReactRoot

japgolly.scalajs.react.test.TestReactRoot
See theTestReactRoot companion object

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

As an example `testRoot.innerHTML.assert("

Welcome")`

Attributes

Since

3.0.0 / React 18

Companion
object
Graph
Supertypes
trait TestDom
class Object
trait Matchable
class Any

Members list

Type members

Types

override type Self <: TestDomWithRoot

Value members

Abstract methods

def root: ReactRoot

Concrete methods

def act[F[_] : Async, A](body: F[A]): F[A]
def actSync[A](body: => A): A
def act_[F[_] : Async, A](body: => A): F[A]
def raw: RootType
def render[F[_] : Async, A : Renderable](unmounted: A): F[Unit]
def renderSync[A : Renderable](unmounted: A): Unit
def unmount[F[_] : Async](): F[Unit]
def unmountSync(): Unit

Inherited methods

def as[A](implicit ct: ClassTag[A]): A

Cast the DOM as A or throw an exception.

Cast the DOM as A or throw an exception.

Attributes

Inherited from:
TestDom
def asButton(): HTMLButtonElement

Attributes

Inherited from:
TestDom
def asDocument(): Document

Attributes

Inherited from:
TestDom
def asDocumentFragment(): DocumentFragment

Attributes

Inherited from:
TestDom
def asElement(): Element

Attributes

Inherited from:
TestDom
def asHtml(): HTMLElement

Attributes

Inherited from:
TestDom
def asInput(): HTMLInputElement

Attributes

Inherited from:
TestDom
final def asNode: Node

Attributes

Inherited from:
TestContainer
def asSelect(): HTMLSelectElement

Attributes

Inherited from:
TestDom
def asTextArea(): HTMLTextAreaElement

Attributes

Inherited from:
TestDom
def children(): Vector[Node]

Attributes

Inherited from:
TestDom
def container: Container

Attributes

Inherited from:
TestContainer
def firstChild(): Option[Node]

Attributes

Inherited from:
TestDom
def fold[A](onElement: Element => A, onDocument: Document => A, onDocumentFragment: DocumentFragment => A): A

Attributes

Inherited from:
TestContainer

Attributes

Inherited from:
TestDom
def isEmpty(): Boolean

Attributes

Inherited from:
TestContainer
final override def node: Some[Node]

Attributes

Definition Classes
Inherited from:
TestContainer
final def nonEmpty(): Boolean

Attributes

Inherited from:
TestContainer

Attributes

Inherited from:
TestDom
def querySelector(selectors: String): Element

Attributes

Inherited from:
TestDom
def querySelectorAll(selectors: String): Vector[Element]

Attributes

Inherited from:
TestDom
def querySelectorOption(selectors: String): Option[Element]

Attributes

Inherited from:
TestDom
def select(selectors: String): Self

Attributes

Inherited from:
TestDom
def select(f: Node => Node): Self

Attributes

Inherited from:
TestDom
def selectFirst(selectors: String): Self

Attributes

Inherited from:
TestDom

Attributes

Inherited from:
TestDom