Object

japgolly.scalajs.react.test

ReactTestUtils

Related Doc: package test

Permalink

object ReactTestUtils

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReactTestUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type CompType = ComponentRaw { type Raw <: japgolly.scalajs.react.raw.React.ComponentClassUntyped }

    Permalink
  2. type Mounted = MountedRaw

    Permalink
  3. type MountedOutput = component.Js.Mounted[_ <: Object, _ <: Object]

    Permalink
  4. type Unmounted[M] = component.Generic.Unmounted[_, M]

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def findAllInRenderedTree(tree: Mounted, test: (MountedOutput) ⇒ Boolean): Vector[MountedOutput]

    Permalink

    Traverse all components in tree and accumulate all components where test(component) is true.

    Traverse all components in tree and accumulate all components where test(component) is true. This is not that useful on its own, but it's used as a primitive for other test utils.

  10. def findRenderedComponentWithType(tree: Mounted, c: CompType): MountedOutput

    Permalink

    Same as scryRenderedComponentsWithType() but expects there to be one result and returns that one result, or throws exception if there is any other number of matches besides one.

  11. def findRenderedDOMComponentWithClass(tree: Mounted, className: String): MountedOutput

    Permalink

    Like scryRenderedDOMComponentsWithClass() but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.

  12. def findRenderedDOMComponentWithTag(tree: Mounted, tagName: String): MountedOutput

    Permalink

    Like scryRenderedDOMComponentsWithTag() but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.

  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def modifyProps[P, U <: component.Generic.Unmounted[P, M], M <: MountedImpure[P, _]](c: GenericComponent[P, Props, U], m: M)(f: (P) ⇒ P): M

    Permalink
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def newBodyElement(): Element

    Permalink
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def raw: raw.ReactTestUtils.type

    Permalink
  22. def removeNewBodyElement(e: Element): Unit

    Permalink
  23. def removeReactInternals(html: String): String

    Permalink

    Turn <div data-reactroot="">hello&lt/div> into <div>hello&lt/div>

  24. def renderIntoBody[M, A](u: Unmounted[M]): M

    Permalink

    Renders a component into the document body via ReactDOM.render().

    Renders a component into the document body via ReactDOM.render().

    Unlike ReactTestUtils.renderIntoDocument(), this allows DOM focus to work.

  25. def renderIntoDocument(e: VdomElement): MountedOutput

    Permalink
  26. def renderIntoDocument[M](unmounted: Unmounted[M]): M

    Permalink

    Render a component into a detached DOM node in the document.

    Render a component into a detached DOM node in the document. This function requires a DOM.

  27. def replaceProps[P, U <: component.Generic.Unmounted[P, M], M <: MountedImpure[P, _]](c: GenericComponent[P, Props, U], m: M)(p: P): M

    Permalink
  28. def scryRenderedComponentsWithType(tree: Mounted, c: CompType): Vector[MountedOutput]

    Permalink

    Finds all instances of components with type equal to componentClass.

  29. def scryRenderedDOMComponentsWithClass(tree: Mounted, className: String): Vector[MountedOutput]

    Permalink

    Finds all instance of components in the rendered tree that are DOM components with the class name matching className.

  30. def scryRenderedDOMComponentsWithTag(tree: Mounted, tagName: String): Vector[MountedOutput]

    Permalink

    Finds all instance of components in the rendered tree that are DOM components with the tag name matching tagName.

  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def withNewBodyElement[A](use: (Element) ⇒ A): A

    Permalink
  37. def withNewBodyElementAsync[A](use: (Element) ⇒ Future[A])(implicit ec: ExecutionContext): Future[A]

    Permalink
  38. def withRendered[M, A](u: Unmounted[M], intoBody: Boolean)(f: (M) ⇒ A): A

    Permalink

    Renders a component then unmounts and cleans up after use.

    Renders a component then unmounts and cleans up after use.

    intoBody

    Whether to use renderIntoBody() or ReactTestUtils.renderIntoDocument().

  39. def withRenderedAsync[M, A](u: Unmounted[M], intoBody: Boolean)(f: (M) ⇒ Future[A])(implicit ec: ExecutionContext): Future[A]

    Permalink

    Renders a component then unmounts and cleans up after use.

    Renders a component then unmounts and cleans up after use.

    intoBody

    Whether to use renderIntoBodyAsync() or renderIntoDocumentAsync().

  40. def withRenderedIntoBody[M, A](u: Unmounted[M])(f: (M) ⇒ A): A

    Permalink

    Renders a component into the document body via ReactDOM.render(), then unmounts and cleans up after use.

    Renders a component into the document body via ReactDOM.render(), then unmounts and cleans up after use.

    Unlike ReactTestUtils.renderIntoDocument(), this allows DOM focus to work.

  41. def withRenderedIntoBodyAsync[M, A](u: Unmounted[M])(f: (M) ⇒ Future[A])(implicit ec: ExecutionContext): Future[A]

    Permalink

    Renders a component into the document body via ReactDOM.render(), and asynchronously waits for the Future to complete before unmounting.

  42. def withRenderedIntoDocument[M, A](u: Unmounted[M])(f: (M) ⇒ A): A

    Permalink

    Renders a component into detached DOM via ReactTestUtils.renderIntoDocument(), then unmounts and cleans up after use.

  43. def withRenderedIntoDocumentAsync[M, A](u: Unmounted[M])(f: (M) ⇒ Future[A])(implicit ec: ExecutionContext): Future[A]

    Permalink

    Renders a component into detached DOM via ReactTestUtils.renderIntoDocument(), and asynchronously waits for the Future to complete before unmounting.

Inherited from AnyRef

Inherited from Any

Ungrouped