Module

Enzyme.ReactWrapper

Package
purescript-enzyme
Repository
coot/purescript-enzyme

#ReactWrapper Source

#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

#containsAllMatchingElements Source

#containsAnyMatchingElements Source

#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

#is Source

is :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean

#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

#text Source

text :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) String

#html Source

html :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) String

#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

#props Source

props :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) Foreign

#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.

#context Source

context :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Foreign

#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

#prop Source

prop :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Foreign

#key Source

key :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) String

#type_ Source

type_ :: forall e p. ReactWrapper -> Eff (enzyme :: ENZYME | e) (Either String (ReactClass p))

#name Source

name :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) String

#hasClass Source

hasClass :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean

#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

#some Source

some :: forall e. String -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean

#someWhere Source

someWhere :: forall e. (ReactWrapper -> Boolean) -> ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean

#every Source

every :: forall e. String -> 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

#isEmpty Source

isEmpty :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean

#exists Source

exists :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) Boolean

#debug Source

debug :: forall e. ReactWrapper -> Eff (enzyme :: ENZYME | e) String

#detach Source

detach :: forall e. ReactWrapper -> Eff (dom :: DOM, enzyme :: ENZYME | e) Unit