Module

React.TestingLibrary

#cleanup

#TextMatch

class TextMatch a 

Instances

#describeComponent

describeComponent :: forall props. (Effect (ReactComponent props)) -> String -> SpecT Aff (ReactComponent props) Identity Unit -> Spec Unit

Example use:

spec = describeComponent mkMyComponent "My Component" do
 it "renders" \myComponent ->
   { findByText } <- renderComponent myComponent { someProp: "test text"} 
   result <- findByText "test text"
   result `textContentShouldEqual` "I am rendering test text"

#FakeKeyboardEvent

type FakeKeyboardEvent = { altKey :: Boolean, charCode :: Int, ctrlKey :: Boolean, key :: String, keyCode :: Int, location :: Number, metaKey :: Boolean, repeat :: Boolean, shiftKey :: Boolean, which :: Int }

#fireEvent

fireEvent :: forall m. MonadEffect m => HTMLElement -> Event -> m Unit

#fireEventAbort

#fireEventAnimationEnd

#fireEventAnimationIteration

#fireEventAnimationStart

#fireEventBlur

fireEventBlur :: forall m. MonadEffect m => HTMLElement -> m Unit

#fireEventCanPlay

#fireEventCanPlayThrough

#fireEventChange

fireEventChange :: forall r m. MonadEffect m => Record r -> HTMLElement -> m Unit

#fireEventClick

#fireEventCompositionEnd

#fireEventCompositionStart

#fireEventCompositionUpdate

#fireEventContextMenu

#fireEventCopy

fireEventCopy :: forall m. MonadEffect m => HTMLElement -> m Unit

#fireEventCut

fireEventCut :: forall m. MonadEffect m => HTMLElement -> m Unit

#fireEventDblClick

#fireEventDoubleClick

#fireEventDrag

fireEventDrag :: forall m. MonadEffect m => HTMLElement -> m Unit

#fireEventDragEnd

#fireEventDragEnter

#fireEventDragExit

#fireEventDragLeave

#fireEventDragOver

#fireEventDragStart

#fireEventDrop

fireEventDrop :: forall m. MonadEffect m => HTMLElement -> m Unit

#fireEventDurationChange

#fireEventEmptied

#fireEventEncrypted

#fireEventEnded

#fireEventError

#fireEventFocus

#fireEventFocusIn

#fireEventFocusOut

#fireEventInput

#fireEventInvalid

#fireEventKeyDown

#fireEventKeyPress

#fireEventKeyUp

#fireEventLoad

fireEventLoad :: forall m. MonadEffect m => HTMLElement -> m Unit

#fireEventLoadedData

#fireEventLoadedMetadata

#fireEventLoadStart

#fireEventMouseDown

#fireEventMouseEnter

#fireEventMouseLeave

#fireEventMouseMove

#fireEventMouseOut

#fireEventMouseOver

#fireEventMouseUp

#fireEventPaste

#fireEventPause

#fireEventPlay

fireEventPlay :: forall m. MonadEffect m => HTMLElement -> m Unit

#fireEventPlaying

#fireEventPointerCancel

#fireEventPointerDown

#fireEventPointerMove

#fireEventPointerOut

#fireEventPointerOver

#fireEventPointerUp

#fireEventProgress

#fireEventRateChange

#fireEventScroll

#fireEventSeeked

#fireEventSeeking

#fireEventSelect

#fireEventStalled

#fireEventSubmit

#fireEventSuspend

#fireEventTimeUpdate

#fireEventTouchCancel

#fireEventTouchEnd

#fireEventTouchMove

#fireEventTouchStart

#fireEventTransitionEnd

#fireEventVolumeChange

#fireEventWaiting

#fireEventWheel

#render

render :: forall m. MonadEffect m => JSX -> m RenderQueries

Renders some JSX

#renderComponent

#RenderQueries

type RenderQueries = { findAllByAltText :: forall tm. TextMatch tm => tm -> Aff (Array HTMLElement), findAllByDisplayValue :: forall tm. TextMatch tm => tm -> Aff (Array HTMLElement), findAllByLabelText :: forall tm. TextMatch tm => tm -> Aff (Array HTMLElement), findAllByPlaceholderText :: forall tm. TextMatch tm => tm -> Aff (Array HTMLElement), findAllByRole :: forall tm. TextMatch tm => tm -> Aff (Array HTMLElement), findAllByTestId :: forall tm. TextMatch tm => tm -> Aff (Array HTMLElement), findAllByText :: forall tm. TextMatch tm => tm -> Aff (Array HTMLElement), findAllByTitle :: forall tm. TextMatch tm => tm -> Aff (Array HTMLElement), findByAltText :: forall tm. TextMatch tm => tm -> Aff HTMLElement, findByDisplayValue :: forall tm. TextMatch tm => tm -> Aff HTMLElement, findByLabelText :: forall tm. TextMatch tm => tm -> Aff HTMLElement, findByPlaceholderText :: forall tm. TextMatch tm => tm -> Aff HTMLElement, findByRole :: forall tm. TextMatch tm => tm -> Aff HTMLElement, findByTestId :: forall tm. TextMatch tm => tm -> Aff HTMLElement, findByText :: forall tm. TextMatch tm => tm -> Aff HTMLElement, findByTitle :: forall tm. TextMatch tm => tm -> Aff HTMLElement, queryAllByAltText :: forall tm. TextMatch tm => tm -> Maybe (Array HTMLElement), queryAllByDisplayValue :: forall tm. TextMatch tm => tm -> Maybe (Array HTMLElement), queryAllByLabelText :: forall tm. TextMatch tm => tm -> Maybe (Array HTMLElement), queryAllByPlaceholderText :: forall tm. TextMatch tm => tm -> Maybe (Array HTMLElement), queryAllByRole :: forall tm. TextMatch tm => tm -> Maybe (Array HTMLElement), queryAllByTestId :: forall tm. TextMatch tm => tm -> Maybe (Array HTMLElement), queryAllByText :: forall tm. TextMatch tm => tm -> Maybe (Array HTMLElement), queryAllByTitle :: forall tm. TextMatch tm => tm -> Maybe (Array HTMLElement), queryByAltText :: forall tm. TextMatch tm => tm -> Maybe HTMLElement, queryByDisplayValue :: forall tm. TextMatch tm => tm -> Maybe HTMLElement, queryByLabelText :: forall tm. TextMatch tm => tm -> Maybe HTMLElement, queryByPlaceholderText :: forall tm. TextMatch tm => tm -> Maybe HTMLElement, queryByRole :: forall tm. TextMatch tm => tm -> Maybe HTMLElement, queryByTestId :: forall tm. TextMatch tm => tm -> Maybe HTMLElement, queryByText :: forall tm. TextMatch tm => tm -> Maybe HTMLElement, queryByTitle :: forall tm. TextMatch tm => tm -> Maybe HTMLElement }

#typeText

Modules