Packages

object ReactTestUtils extends Object with ReactTestUtils

https://facebook.github.io/react/docs/test-utils.html

Annotations
@JSImport("react-dom/test-utils", JSImport.Namespace, "ReactTestUtils") @native()
Linear Supertypes
ReactTestUtils, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReactTestUtils
  2. ReactTestUtils
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final type Mounted = Component[_ <: Object, _ <: Object]
    Definition Classes
    ReactTestUtils

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final val Simulate: Simulate
    Definition Classes
    ReactTestUtils
  5. final def act(body: Function0[Any]): Thenable[Unit]

    When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface.

    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.

    Definition Classes
    ReactTestUtils
  6. final def actAsync(body: Function0[Thenable[Any]]): Thenable[Unit]

    When writing UI tests, tasks like rendering, user events, or data fetching can be considered as "units" of interaction with a user interface.

    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.

    Definition Classes
    ReactTestUtils
    Annotations
    @JSName("act")
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. final def findAllInRenderedTree(tree: Mounted, test: Function1[Mounted, Boolean]): Array[Mounted]

    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.

    Definition Classes
    ReactTestUtils
  12. final def findRenderedComponentWithType(tree: Mounted, c: ComponentClassUntyped): Mounted

    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.

    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.

    Definition Classes
    ReactTestUtils
  13. final def findRenderedDOMComponentWithClass(tree: Mounted, className: String): Mounted

    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.

    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.

    Definition Classes
    ReactTestUtils
  14. final def findRenderedDOMComponentWithTag(tree: Mounted, tagName: String): Mounted

    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.

    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.

    Definition Classes
    ReactTestUtils
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def isComponentOfType(instance: Element, c: ComponentClassUntyped): Boolean

    Returns true if instance is an instance of a React componentClass.

    Returns true if instance is an instance of a React componentClass.

    Definition Classes
    ReactTestUtils
  19. final def isCompositeComponent(instance: Element): Boolean

    Returns true if instance is a composite component (created with React.createClass())

    Returns true if instance is a composite component (created with React.createClass())

    Definition Classes
    ReactTestUtils
  20. final def isCompositeComponentWithType(instance: Element, c: ComponentClassUntyped): Boolean

    The combination of isComponentOfType() and isCompositeComponent().

    The combination of isComponentOfType() and isCompositeComponent().

    Definition Classes
    ReactTestUtils
  21. final def isDOMComponent(instance: Element): Boolean

    Returns true if instance is a DOM component (such as a <div> or <span>).

    Returns true if instance is a DOM component (such as a <div> or <span>).

    Definition Classes
    ReactTestUtils
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  24. final def mockComponent[P <: Object, S <: Object](c: ComponentClass[P, S], mockTagName: String = js.native): ComponentClass[P, S]

    Pass a mocked component module to this method to augment it with useful methods that allow it to be used as a dummy React component.

    Pass a mocked component module to this method to augment it with useful methods that allow it to be used as a dummy React component. Instead of rendering as usual, the component will become a simple <div> (or other tag if mockTagName is provided) containing any provided children.

    Definition Classes
    ReactTestUtils
  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  29. final def renderIntoDocument(element: Element): |[ComponentUntyped, Null]

    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.

    Definition Classes
    ReactTestUtils
  30. final def scryRenderedComponentsWithType(tree: Mounted, c: ComponentClassUntyped): Array[Mounted]

    Finds all instances of components with type equal to componentClass.

    Finds all instances of components with type equal to componentClass.

    Definition Classes
    ReactTestUtils
  31. final def scryRenderedDOMComponentsWithClass(tree: Mounted, className: String): Array[Mounted]

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

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

    Definition Classes
    ReactTestUtils
  32. final def scryRenderedDOMComponentsWithTag(tree: Mounted, tagName: String): Array[Mounted]

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

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

    Definition Classes
    ReactTestUtils
  33. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  34. def toLocaleString(): String
    Definition Classes
    Object
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. def valueOf(): Any
    Definition Classes
    Object
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from ReactTestUtils

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped