[test] move some Arbitrary instances to Test/Instances.hs

parent bb282d02
Pipeline #7213 passed with stages
in 86 minutes and 58 seconds
...@@ -26,8 +26,7 @@ import Gargantext.Core.Types (TODO(..)) ...@@ -26,8 +26,7 @@ import Gargantext.Core.Types (TODO(..))
import Gargantext.Core.Utils.Aeson (jsonOptions) import Gargantext.Core.Utils.Aeson (jsonOptions)
import Gargantext.Prelude import Gargantext.Prelude
import PUBMED.Types qualified as PUBMED import PUBMED.Types qualified as PUBMED
import Test.QuickCheck (elements)
import Test.QuickCheck.Arbitrary
type EPOAPIToken = Text type EPOAPIToken = Text
type EPOAPIUser = Text type EPOAPIUser = Text
...@@ -94,11 +93,6 @@ data ScraperEvent = ScraperEvent ...@@ -94,11 +93,6 @@ data ScraperEvent = ScraperEvent
, _scev_date :: !(Maybe Text) , _scev_date :: !(Maybe Text)
} }
deriving (Show, Generic, Eq) deriving (Show, Generic, Eq)
instance Arbitrary ScraperEvent where
arbitrary = ScraperEvent <$> elements [Nothing, Just "test message"]
<*> elements [Nothing, Just "INFO", Just "WARN"]
<*> elements [Nothing, Just "2018-04-18"]
instance ToJSON ScraperEvent where instance ToJSON ScraperEvent where
toJSON = genericToJSON $ jsonOptions "_scev_" toJSON = genericToJSON $ jsonOptions "_scev_"
instance FromJSON ScraperEvent where instance FromJSON ScraperEvent where
...@@ -121,12 +115,6 @@ makeLenses ''JobLog ...@@ -121,12 +115,6 @@ makeLenses ''JobLog
noJobLog :: JobLog noJobLog :: JobLog
noJobLog = JobLog Nothing Nothing Nothing Nothing noJobLog = JobLog Nothing Nothing Nothing Nothing
instance Arbitrary JobLog where
arbitrary = JobLog
<$> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
instance ToJSON JobLog where instance ToJSON JobLog where
toJSON = genericToJSON $ jsonOptions "_scst_" toJSON = genericToJSON $ jsonOptions "_scst_"
instance FromJSON JobLog where instance FromJSON JobLog where
......
...@@ -317,6 +317,18 @@ instance Arbitrary Orch.ExternalAPIs where ...@@ -317,6 +317,18 @@ instance Arbitrary Orch.ExternalAPIs where
-- <*> arbitrary -- _wf_lang -- <*> arbitrary -- _wf_lang
-- <*> arbitrary -- _wf_name -- <*> arbitrary -- _wf_name
instance Arbitrary Orch.ScraperEvent where
arbitrary = Orch.ScraperEvent <$> elements [Nothing, Just "test message"]
<*> elements [Nothing, Just "INFO", Just "WARN"]
<*> elements [Nothing, Just "2018-04-18"]
instance Arbitrary Orch.JobLog where
arbitrary = Orch.JobLog
<$> arbitrary
<*> arbitrary
<*> arbitrary
<*> arbitrary
instance Arbitrary NewWithForm where arbitrary = genericArbitrary instance Arbitrary NewWithForm where arbitrary = genericArbitrary
instance Arbitrary RenameNode where instance Arbitrary RenameNode where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment