@@ -13,6 +13,7 @@
13{-# LANGUAGE RecursiveDo #-}
13{-# LANGUAGE RecursiveDo #-}
14{-# LANGUAGE ScopedTypeVariables #-}
14{-# LANGUAGE ScopedTypeVariables #-}
15{-# LANGUAGE TemplateHaskell #-}
15{-# LANGUAGE TemplateHaskell #-}
16+{-# LANGUAGE TupleSections #-}
16{-# LANGUAGE TypeApplications #-}
17{-# LANGUAGE TypeApplications #-}
17{-# LANGUAGE TypeFamilies #-}
18{-# LANGUAGE TypeFamilies #-}
@@ -133,7 +134,7 @@ main = withSeleniumServer $ \selenium -> do
134tests :: WD.WDConfig -> [Capabilities] -> Selenium -> Spec
135tests :: WD.WDConfig -> [Capabilities] -> Selenium -> Spec
135tests wdConfig caps _selenium = do
136tests wdConfig caps _selenium = do
136− let session' = sessionWith wdConfig "" . using (map (flip (,) "") caps)
137+ let session' = sessionWith wdConfig "" . using (map (,"") caps)
137 runWD = runWDOptions (WdOptions False)
138 runWD = runWDOptions (WdOptions False)
138 describe "text" $ session' $ do
139 describe "text" $ session' $ do
139 it "works" $ runWD $ do
140 it "works" $ runWD $ do
@@ -218,7 +219,7 @@ tests wdConfig caps _selenium = do
218 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
219 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
219 conf = (def :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace)
220 conf = (def :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace)
220 & initialAttributes .~ "id" =: "second"
221 & initialAttributes .~ "id" =: "second"
221− & elementConfig_eventSpec .~ (addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> stopPropagation) def)
222+ & elementConfig_eventSpec .~ addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> stopPropagation) def
222 void $ element "span" conf $ text "hello world"
223 void $ element "span" conf $ text "hello world"
223 performEvent_ $ liftIO (writeRef secondClickedRef True) <$ domEvent Click secondDivEl
224 performEvent_ $ liftIO (writeRef secondClickedRef True) <$ domEvent Click secondDivEl
224 firstClicked <- readRef firstClickedRef
225 firstClicked <- readRef firstClickedRef
@@ -234,7 +235,7 @@ tests wdConfig caps _selenium = do
234 clicked <- testWidget (pure ()) click $ prerender_ (pure ()) $ do
235 clicked <- testWidget (pure ()) click $ prerender_ (pure ()) $ do
235 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
236 let conf :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace
236 conf = (def :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace)
237 conf = (def :: ElementConfig EventResult (SpiderTimeline Global) GhcjsDomSpace)
237− & elementConfig_eventSpec .~ (addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> preventDefault) def)
238+ & elementConfig_eventSpec .~ addEventSpecFlags (Proxy :: Proxy GhcjsDomSpace) Click (\_ -> preventDefault) def
238 & initialAttributes .~ "type" =: "checkbox"
239 & initialAttributes .~ "type" =: "checkbox"
239 void $ element "input" conf $ text "hello world"
240 void $ element "input" conf $ text "hello world"
240 assertEqual "Click not prevented" (False, False) clicked
241 assertEqual "Click not prevented" (False, False) clicked
@@ -340,8 +341,8 @@ tests wdConfig caps _selenium = do
340 testWidget (pure ()) checkValue $ do
341 testWidget (pure ()) checkValue $ do
341 update <- triggerEventWithChan setValueChan
342 update <- triggerEventWithChan setValueChan
342 e <- inputElement $ def & inputElementConfig_setValue .~ update
343 e <- inputElement $ def & inputElementConfig_setValue .~ update
343− performEvent_ $ liftIO . (writeRef valueByUIRef) <$> _inputElement_input e
344+ performEvent_ $ liftIO . writeRef valueByUIRef <$> _inputElement_input e
344− performEvent_ $ liftIO . (writeRef valueRef) <$> updated (value e)
345+ performEvent_ $ liftIO . writeRef valueRef <$> updated (value e)
345 it "sets checked appropriately" $ runWD $ do
346 it "sets checked appropriately" $ runWD $ do
346 checkedByUIRef <- newRef False
347 checkedByUIRef <- newRef False
347 checkedRef <- newRef False
348 checkedRef <- newRef False