Module
Enzyme.ShallowWrapper
- Package
- purescript-enzyme
- Repository
- coot/purescript-enzyme
#ShallowWrapper Source
data ShallowWrapper :: Type
#getNode Source
getNode :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) ReactElement
#getNodes Source
getNodes :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) (Array ReactElement)
#instance_ Source
instance_ :: forall e state props. ShallowWrapper -> Eff (enzyme :: ENZYME | e) (ReactThis props state)
#update Source
update :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#rerender Source
rerender :: forall e props. props -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#rerenderWithContext Source
rerenderWithContext :: forall e context props. props -> context -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#setProps Source
setProps :: forall e r props. props -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) r
#setState Source
setState :: forall e state. state -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
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 -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
The original which does not wrap state.
#setContext Source
setContext :: forall e ctx. ctx -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#containsNode Source
containsNode :: forall e. ReactElement -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#containsNodes Source
containsNodes :: forall e. Array ReactElement -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#containsMatchingElement Source
containsMatchingElement :: forall e. ReactElement -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#containsAllMatchingElements Source
containsAllMatchingElements :: forall e. Array ReactElement -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#containsAnyMatchingElements Source
containsAnyMatchingElements :: forall e. Array ReactElement -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#equals Source
equals :: forall e. ReactElement -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#matchesElement Source
matchesElement :: forall e. ReactElement -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#find Source
find :: forall e. String -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#findReactClass Source
findReactClass :: forall e props. ReactClass props -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#isEmptyRender Source
isEmptyRender :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#filterWhere Source
filterWhere :: forall e. (ShallowWrapper -> Boolean) -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#filter Source
filter :: forall e. String -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#not Source
not :: forall e. String -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#unmount Source
unmount :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#simulate Source
simulate :: forall e. String -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#simulateWithArgs Source
simulateWithArgs :: forall e. String -> Array Foreign -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#state Source
state :: forall e. ShallowWrapper -> 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 -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) state
#state_ Source
state_ :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) Foreign
The original which does not unwrap the state.
#stateByKey Source
stateByKey :: forall e. String -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Foreign
#children Source
children :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#childrenBySelector Source
childrenBySelector :: forall e. String -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#childAt Source
childAt :: forall e. Int -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#parents Source
parents :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#parentsBySelector Source
parentsBySelector :: forall e. String -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#parent Source
parent :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#closest Source
closest :: forall e. String -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#shallow Source
shallow :: forall e. Foreign -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#type_ Source
type_ :: forall p e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) (Either String (ReactClass p))
#map Source
map :: forall e a. (ReactElement -> a) -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) (Array a)
#reduce Source
reduce :: forall e a. (a -> ShallowWrapper -> Int -> a) -> a -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) a
#reduceRight Source
reduceRight :: forall e a. (a -> ShallowWrapper -> Int -> a) -> a -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) a
#slice Source
slice :: forall e. Int -> Int -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#someWhere Source
someWhere :: forall e. (ShallowWrapper -> Boolean) -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#everyWhere Source
everyWhere :: forall e. (ShallowWrapper -> Boolean) -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) Boolean
#findWhere Source
findWhere :: forall e. (ShallowWrapper -> Boolean) -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#get Source
get :: forall e. Int -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ReactElement
#at Source
at :: forall e. Int -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#first Source
first :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#last Source
last :: forall e. ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper
#dive Source
dive :: forall e. Foreign -> ShallowWrapper -> Eff (enzyme :: ENZYME | e) ShallowWrapper