on develop help sign in
Fix hlint test failures
commit2c7ac7ed6af4c971894f486db8aef90e247b4c1d authorAli Abrar <aliabrar@gmail.com> dateFri 8 Mar 2019, 11:52 (8 years ago) parente8c36f6
2 files changed+20−20
reflex-dom-core/test/gc.hs+2−2 reflex-dom-core/test/hydration.hs+18−18
reflex-dom-core/test/gc.hs+2−2
@@ -8,7 +8,7 @@ import Control.Exception
88import Control.Monad
99import Control.Monad.IO.Class
1010import Data.Int
11−import Data.Text
11+import Data.Text as T
1212import Language.Javascript.JSaddle.Warp
1313import Reflex.Dom.Core
1414import Reflex.Time
@@ -52,7 +52,7 @@ main = do
5252 mainThread <- myThreadId
5353 browserProcess <- spawnCommand $ mconcat
5454 [ "echo 'Starting Chromium' ; chromium "
55− , unpack $ intercalate " " chromeFlags
55+ , unpack $ T.unwords chromeFlags
5656 , " http://localhost:3911 ; echo 'Chromium exited'"
5757 ]
5858 let finishTest result = do
reflex-dom-core/test/hydration.hs+18−18
@@ -294,7 +294,7 @@ tests withDebugging wdConfig caps _selenium = do
294294 pure e)
295295 (\e -> do
296296 WD.attr e "value" `shouldBeWithRetryM` Just "hello world"
297− WD.click =<< (findElemWithRetry $ WD.ByTag "button")
297+ WD.click =<< findElemWithRetry (WD.ByTag "button")
298298 readRef inputRef `shouldBeWithRetryM` "hello world"
299299 ) $ do
300300 e <- inputElement def
@@ -303,8 +303,8 @@ tests withDebugging wdConfig caps _selenium = do
303303 it "captures user input after switchover" $ runWD $ do
304304 inputRef <- newRef ("" :: Text)
305305 let checkValue = do
306− WD.sendKeys "hello world" =<< (findElemWithRetry $ WD.ByTag "input")
307− WD.click =<< (findElemWithRetry $ WD.ByTag "button")
306+ WD.sendKeys "hello world" =<< findElemWithRetry (WD.ByTag "input")
307+ WD.click =<< findElemWithRetry (WD.ByTag "button")
308308 readRef inputRef `shouldBeWithRetryM` "hello world"
309309 testWidget (pure ()) checkValue $ do
310310 e <- inputElement def
@@ -378,7 +378,7 @@ tests withDebugging wdConfig caps _selenium = do
378378 e <- findElemWithRetry $ WD.ByTag "input"
379379 path <- liftIO $ writeSystemTempFile "testFile" "file contents"
380380 WD.sendKeys (T.pack path) e
381− WD.click =<< (findElemWithRetry $ WD.ByTag "button")
381+ WD.click =<< findElemWithRetry (WD.ByTag "button")
382382 liftIO $ removeFile path
383383 readRef filesRef `shouldBeWithRetryM` [T.pack $ FilePath.takeFileName path]
384384 testWidget (pure ()) uploadFile $ do
@@ -392,8 +392,8 @@ tests withDebugging wdConfig caps _selenium = do
392392 it "captures user input after switchover" $ runWD $ do
393393 inputRef :: IORef Text <- newRef ""
394394 let checkValue = do
395− WD.sendKeys "hello world" =<< (findElemWithRetry $ WD.ByTag "input")
396− WD.click =<< (findElemWithRetry $ WD.ByTag "button")
395+ WD.sendKeys "hello world" =<< findElemWithRetry (WD.ByTag "input")
396+ WD.click =<< findElemWithRetry (WD.ByTag "button")
397397 readRef inputRef `shouldBeWithRetryM` "hello world"
398398 testWidget (pure ()) checkValue $ prerender_ (pure ()) $ do
399399 e <- inputElement def
@@ -458,7 +458,7 @@ tests withDebugging wdConfig caps _selenium = do
458458 e <- findElemWithRetry $ WD.ByTag "input"
459459 path <- liftIO $ writeSystemTempFile "testFile" "file contents"
460460 WD.sendKeys (T.pack path) e
461− WD.click =<< (findElemWithRetry $ WD.ByTag "button")
461+ WD.click =<< findElemWithRetry (WD.ByTag "button")
462462 liftIO $ removeFile path
463463 readRef filesRef `shouldBeWithRetryM` [T.pack $ FilePath.takeFileName path]
464464 testWidget (pure ()) uploadFile $ prerender_ (pure ()) $ do
@@ -488,8 +488,8 @@ tests withDebugging wdConfig caps _selenium = do
488488 it "captures user input after switchover" $ runWD $ do
489489 inputRef <- newRef ("" :: Text)
490490 let checkValue = do
491− WD.sendKeys "hello world" =<< (findElemWithRetry $ WD.ByTag "textarea")
492− WD.click =<< (findElemWithRetry $ WD.ByTag "button")
491+ WD.sendKeys "hello world" =<< findElemWithRetry (WD.ByTag "textarea")
492+ WD.click =<< findElemWithRetry (WD.ByTag "button")
493493 readRef inputRef `shouldBeWithRetryM` "hello world"
494494 testWidget (pure ()) checkValue $ do
495495 e <- textAreaElement def
@@ -590,12 +590,12 @@ tests withDebugging wdConfig caps _selenium = do
590590 let setup = do
591591 e <- findElemWithRetry $ WD.ByTag "select"
592592 assertAttr e "value" (Just "three")
593− WD.click =<< (findElemWithRetry $ WD.ById "two")
593+ WD.click =<< findElemWithRetry (WD.ById "two")
594594 pure e
595595 check e = do
596596 assertAttr e "value" (Just "two")
597597 readRef inputRef `shouldBeWithRetryM` "three"
598− WD.click =<< (findElemWithRetry $ WD.ByTag "button")
598+ WD.click =<< findElemWithRetry (WD.ByTag "button")
599599 assertAttr e "value" (Just "two")
600600 readRef inputRef `shouldBeWithRetryM` "two"
601601 testWidget' setup check $ do
@@ -608,9 +608,9 @@ tests withDebugging wdConfig caps _selenium = do
608608 let checkValue = do
609609 e <- findElemWithRetry $ WD.ByTag "select"
610610 assertAttr e "value" (Just "one")
611− WD.click =<< (findElemWithRetry $ WD.ById "two")
611+ WD.click =<< findElemWithRetry (WD.ById "two")
612612 assertAttr e "value" (Just "two")
613− WD.click =<< (findElemWithRetry $ WD.ByTag "button")
613+ WD.click =<< findElemWithRetry (WD.ByTag "button")
614614 readRef inputRef `shouldBeWithRetryM` "two"
615615 testWidget (pure ()) checkValue $ do
616616 (e, ()) <- selectElement def options
@@ -840,7 +840,7 @@ tests withDebugging wdConfig caps _selenium = do
840840 replaceChan2 :: Chan Text <- liftIO newChan
841841 lock :: MVar () <- liftIO newEmptyMVar
842842 let check = do
843− shouldContainText "" =<< (findElemWithRetry (WD.ByTag "body"))
843+ shouldContainText "" =<< findElemWithRetry (WD.ByTag "body")
844844 liftIO $ do
845845 writeChan replaceChan1 "one"
846846 takeMVar lock
@@ -926,8 +926,8 @@ tests withDebugging wdConfig caps _selenium = do
926926 checkItem :: WD.Element -> Text -> Text -> WD ()
927927 checkItem li k v = do
928928 putStrLnDebug "checkItem"
929− shouldContainTextNoRetry k =<< (WD.findElemFrom li (WD.ByClass "key"))
930− shouldContainTextNoRetry v =<< (WD.findElemFrom li (WD.ByClass "value"))
929+ shouldContainTextNoRetry k =<< WD.findElemFrom li (WD.ByClass "key")
930+ shouldContainTextNoRetry v =<< WD.findElemFrom li (WD.ByClass "value")
931931 checkInitialItems dm xs = do
932932 putStrLnDebug "checkInitialItems"
933933 liftIO $ assertEqual "Wrong amount of items in DOM" (DMap.size dm) (length xs)
@@ -1139,8 +1139,8 @@ tests withDebugging wdConfig caps _selenium = do
11391139 Key2_Char c -> "c" <> T.pack [c]
11401140 checkItem :: WD.Element -> Text -> Text -> WD ()
11411141 checkItem li k v = do
1142− shouldContainTextNoRetry k =<< (WD.findElemFrom li (WD.ByClass "key"))
1143− shouldContainTextNoRetry v =<< (WD.findElemFrom li (WD.ByClass "value"))
1142+ shouldContainTextNoRetry k =<< WD.findElemFrom li (WD.ByClass "key")
1143+ shouldContainTextNoRetry v =<< WD.findElemFrom li (WD.ByClass "value")
11441144 checkInitialItems dm xs = do
11451145 liftIO $ assertEqual "Wrong amount of items in DOM" (DMap.size dm) (length xs)
11461146 forM_ (zip xs (DMap.toList dm)) $ \(e, k :=> Identity v) -> checkItem e (textKey2 k) (T.pack $ has @Show k $ show v)