Module
Enzyme.ReactWrapper
- Package
- purescript-enzyme
- Repository
- coot/purescript-enzyme
#ReactWrapper Source
data ReactWrapper :: Type
#getNode Source
getNode :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactElement
#getNodes Source
getNodes :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) (Array ReactElement)
#getDOMNode Source
getDOMNode :: forall e. ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) HTMLElement
#ref Source
ref :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#instance_ Source
instance_ :: forall state props e. ReactWrapper -> Eff (enzyme :: ENZYME | e) (ReactThis props state)
#update Source
update :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#unmount Source
unmount :: forall e. ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) ReactWrapper
#mount Source
mount :: forall e. ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) ReactWrapper
#setProps Source
setProps :: forall e props. props -> ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) ReactWrapper
#setState Source
setState :: forall e state. state -> ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) ReactWrapper
Set state of your component. Note that it will wrap state as { state: state }
,
since this is what purescript-react
does in it's own bindings.
#setState_ Source
setState_ :: forall e. Foreign -> ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) ReactWrapper
The original which does not wrap state
#setContext Source
setContext :: forall e ctx. ctx -> ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) ReactWrapper
#matchesElement Source
matchesElement :: forall e. ReactElement -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#containsNode Source
containsNode :: forall e. ReactElement -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#containsNodes Source
containsNodes :: forall e. Array ReactElement -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#containsMatchingElement Source
containsMatchingElement :: forall e. ReactElement -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#containsAllMatchingElements Source
containsAllMatchingElements :: forall e. Array ReactElement -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#containsAnyMatchingElements Source
containsAnyMatchingElements :: forall e. Array ReactElement -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#find Source
find :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#findReactClass Source
findReactClass :: forall e props. ReactClass props -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#isEmptyRender Source
isEmptyRender :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#filterWhere Source
filterWhere :: forall e. (ReactWrapper -> Boolean) -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#filter Source
filter :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#not Source
not :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#simulate Source
simulate :: forall e. String -> ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) ReactWrapper
#simulateAndMock Source
simulateAndMock :: forall e. String -> Foreign -> ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) ReactWrapper
#state Source
state :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) (F Foreign)
Note that purescript-react
writes state as { state: state }
(so you can use any purescript value as a state). This function will unwrap
state and return what you specified in your ReactSpec
signature.
Use runExcept $ join ((readState :: Foreign -> State) <$> state)
to read
the state from F Foreign
.
#unsafeState Source
unsafeState :: forall state e. Proxy state -> ReactWrapper -> Eff (enzyme :: ENZYME | e) state
#state_ Source
state_ :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) Foreign
The original which does not unwrap the state.
#stateByKey Source
stateByKey :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Foreign
The same note above applied to stateByKey
.
#children Source
children :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#childrenBySelector Source
childrenBySelector :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#childAt Source
childAt :: forall e. Int -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#parents Source
parents :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#parentsBySelector Source
parentsBySelector :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#parent Source
parent :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#closest Source
closest :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#type_ Source
type_ :: forall e p. ReactWrapper -> Eff (enzyme :: ENZYME | e) (Either String (ReactClass p))
#map Source
map :: forall e a. (ReactElement -> a) -> ReactWrapper -> Eff (enzyme :: ENZYME | e) (Array a)
#reduce Source
reduce :: forall e a. (a -> ReactWrapper -> Int -> a) -> a -> ReactWrapper -> Eff (enzyme :: ENZYME | e) a
#reduceRight Source
reduceRight :: forall e a. (a -> ReactWrapper -> Int -> a) -> a -> ReactWrapper -> Eff (enzyme :: ENZYME | e) a
#slice Source
slice :: forall e. Int -> Int -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#someWhere Source
someWhere :: forall e. (ReactWrapper -> Boolean) -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#everyWhere Source
everyWhere :: forall e. (ReactWrapper -> Boolean) -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#get Source
get :: forall e. Int -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactElement
#at Source
at :: forall e. Int -> ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#first Source
first :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper
#last Source
last :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) ReactWrapper