[central exchange] add Eq, fix tests

parent 58526e66
Pipeline #6475 failed with stages
in 18 minutes and 8 seconds
......@@ -25,7 +25,7 @@ import Gargantext.Core.Types (NodeId)
import Gargantext.Prelude
import Prelude qualified
import Servant.Job.Core (Safety(Safe))
import Servant.Job.Types (JobStatus)
import Servant.Job.Types (JobStatus(_job_id))
{-
......@@ -39,6 +39,11 @@ various events).
data CEMessage =
UpdateJobProgress (JobStatus 'Safe JobLog)
| UpdateTreeFirstLevel NodeId
-- | This is for testing
instance Eq CEMessage where
(==) (UpdateJobProgress js1) (UpdateJobProgress js2) = _job_id js1 == _job_id js2
(==) (UpdateTreeFirstLevel n1) (UpdateTreeFirstLevel n2) = n1 == n2
(==) _ _ = False
instance Prelude.Show CEMessage where
show (UpdateJobProgress js) = "UpdateJobProgress " <> (CBUTF8.decode $ BSL.unpack $ Aeson.encode js)
show (UpdateTreeFirstLevel nodeId) = "UpdateTreeFirstLevel " <> show nodeId
......
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