Module
React.TestingLibrary
- Package
- purescript-react-testing-library
- Repository
- i-am-the-slime/purescript-react-testing-library
#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"
#findByText Source
findByText :: HTMLElement -> String -> Aff HTMLElement
#fireEvent Source
fireEvent :: forall m. MonadEffect m => HTMLElement -> Event -> m Unit
#fireEventAbort Source
fireEventAbort :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventAnimationEnd Source
fireEventAnimationEnd :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventAnimationIteration Source
fireEventAnimationIteration :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventAnimationStart Source
fireEventAnimationStart :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventBlur Source
fireEventBlur :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventCanPlay Source
fireEventCanPlay :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventCanPlayThrough Source
fireEventCanPlayThrough :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventChange Source
fireEventChange :: forall r m. MonadEffect m => Record r -> HTMLElement -> m Unit
#fireEventClick Source
fireEventClick :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventCompositionEnd Source
fireEventCompositionEnd :: forall m. MonadEffect m => String -> HTMLElement -> m Unit
#fireEventCompositionStart Source
fireEventCompositionStart :: forall m. MonadEffect m => String -> HTMLElement -> m Unit
#fireEventCompositionUpdate Source
fireEventCompositionUpdate :: forall m. MonadEffect m => String -> HTMLElement -> m Unit
#fireEventContextMenu Source
fireEventContextMenu :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventCopy Source
fireEventCopy :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventCut Source
fireEventCut :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDblClick Source
fireEventDblClick :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDoubleClick Source
fireEventDoubleClick :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDrag Source
fireEventDrag :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDragEnd Source
fireEventDragEnd :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDragEnter Source
fireEventDragEnter :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDragExit Source
fireEventDragExit :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDragLeave Source
fireEventDragLeave :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDragOver Source
fireEventDragOver :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDragStart Source
fireEventDragStart :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDrop Source
fireEventDrop :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventDurationChange Source
fireEventDurationChange :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventEmptied Source
fireEventEmptied :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventEncrypted Source
fireEventEncrypted :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventEnded Source
fireEventEnded :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventError Source
fireEventError :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventFocus Source
fireEventFocus :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventFocusIn Source
fireEventFocusIn :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventFocusOut Source
fireEventFocusOut :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventInput Source
fireEventInput :: forall m. MonadEffect m => HTMLElement -> String -> m Unit
#fireEventInvalid Source
fireEventInvalid :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventKeyDown Source
fireEventKeyDown :: forall m. MonadEffect m => FakeKeyboardEvent -> HTMLElement -> m Unit
#fireEventKeyPress Source
fireEventKeyPress :: forall m. MonadEffect m => FakeKeyboardEvent -> HTMLElement -> m Unit
#fireEventKeyUp Source
fireEventKeyUp :: forall m. MonadEffect m => FakeKeyboardEvent -> HTMLElement -> m Unit
#fireEventLoad Source
fireEventLoad :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventLoadedData Source
fireEventLoadedData :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventLoadedMetadata Source
fireEventLoadedMetadata :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventLoadStart Source
fireEventLoadStart :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventMouseDown Source
fireEventMouseDown :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventMouseEnter Source
fireEventMouseEnter :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventMouseLeave Source
fireEventMouseLeave :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventMouseMove Source
fireEventMouseMove :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventMouseOut Source
fireEventMouseOut :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventMouseOver Source
fireEventMouseOver :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventMouseUp Source
fireEventMouseUp :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPaste Source
fireEventPaste :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPause Source
fireEventPause :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPlay Source
fireEventPlay :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPlaying Source
fireEventPlaying :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPointerCancel Source
fireEventPointerCancel :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPointerDown Source
fireEventPointerDown :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPointerMove Source
fireEventPointerMove :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPointerOut Source
fireEventPointerOut :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPointerOver Source
fireEventPointerOver :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventPointerUp Source
fireEventPointerUp :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventProgress Source
fireEventProgress :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventRateChange Source
fireEventRateChange :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventScroll Source
fireEventScroll :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventSeeked Source
fireEventSeeked :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventSeeking Source
fireEventSeeking :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventSelect Source
fireEventSelect :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventStalled Source
fireEventStalled :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventSubmit Source
fireEventSubmit :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventSuspend Source
fireEventSuspend :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventTimeUpdate Source
fireEventTimeUpdate :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventTouchCancel Source
fireEventTouchCancel :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventTouchEnd Source
fireEventTouchEnd :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventTouchMove Source
fireEventTouchMove :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventTouchStart Source
fireEventTouchStart :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventTransitionEnd Source
fireEventTransitionEnd :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventVolumeChange Source
fireEventVolumeChange :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventWaiting Source
fireEventWaiting :: forall m. MonadEffect m => HTMLElement -> m Unit
#fireEventWheel Source
fireEventWheel :: forall m. MonadEffect m => HTMLElement -> m Unit
#render Source
render :: forall m. MonadEffect m => JSX -> m RenderQueries
Renders some JSX
#renderComponent Source
renderComponent :: forall m p. MonadEffect m => ReactComponent (Record p) -> Record p -> m RenderQueries
#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 }