Module

React.TestingLibrary

Package
purescript-react-testing-library
Repository
i-am-the-slime/purescript-react-testing-library

#TextMatch Source

class TextMatch a 

Instances

#describeComponent Source

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 Source

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

#fireEvent Source

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

#fireEventAbort Source

#fireEventAnimationEnd Source

#fireEventAnimationIteration Source

#fireEventAnimationStart Source

#fireEventBlur Source

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

#fireEventCanPlay Source

#fireEventCanPlayThrough Source

#fireEventChange Source

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

#fireEventClick Source

#fireEventCompositionEnd Source

#fireEventCompositionStart Source

#fireEventCompositionUpdate Source

#fireEventContextMenu Source

#fireEventCopy Source

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

#fireEventCut Source

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

#fireEventDblClick Source

#fireEventDoubleClick Source

#fireEventDrag Source

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

#fireEventDragEnd Source

#fireEventDragEnter Source

#fireEventDragExit Source

#fireEventDragLeave Source

#fireEventDragOver Source

#fireEventDragStart Source

#fireEventDrop Source

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

#fireEventDurationChange Source

#fireEventEmptied Source

#fireEventEncrypted Source

#fireEventEnded Source

#fireEventError Source

#fireEventFocus Source

#fireEventFocusIn Source

#fireEventFocusOut Source

#fireEventInput Source

#fireEventInvalid Source

#fireEventKeyDown Source

#fireEventKeyPress Source

#fireEventKeyUp Source

#fireEventLoad Source

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

#fireEventLoadedData Source

#fireEventLoadedMetadata Source

#fireEventLoadStart Source

#fireEventMouseDown Source

#fireEventMouseEnter Source

#fireEventMouseLeave Source

#fireEventMouseMove Source

#fireEventMouseOut Source

#fireEventMouseOver Source

#fireEventMouseUp Source

#fireEventPaste Source

#fireEventPause Source

#fireEventPlay Source

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

#fireEventPlaying Source

#fireEventPointerCancel Source

#fireEventPointerDown Source

#fireEventPointerMove Source

#fireEventPointerOut Source

#fireEventPointerOver Source

#fireEventPointerUp Source

#fireEventProgress Source

#fireEventRateChange Source

#fireEventScroll Source

#fireEventSeeked Source

#fireEventSeeking Source

#fireEventSelect Source

#fireEventStalled Source

#fireEventSubmit Source

#fireEventSuspend Source

#fireEventTimeUpdate Source

#fireEventTouchCancel Source

#fireEventTouchEnd Source

#fireEventTouchMove Source

#fireEventTouchStart Source

#fireEventTransitionEnd Source

#fireEventVolumeChange Source

#fireEventWaiting Source

#fireEventWheel Source

#render Source

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

Renders some JSX

#renderComponent Source

#RenderQueries Source

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 }