2022-04-10 07:47:15 +03:00
|
|
|
module Test.QuerySpec (spec) where
|
|
|
|
|
|
|
|
import Control.Monad (when)
|
2022-06-16 11:30:01 +03:00
|
|
|
import Data.Maybe (isJust)
|
2022-09-20 06:59:47 +03:00
|
|
|
import Hasura.Backends.DataConnector.API (Capabilities (..), ComparisonCapabilities (_ccCrossTableComparisonCapabilities), Config, Routes (..), SourceName)
|
2022-04-10 07:47:15 +03:00
|
|
|
import Servant.API (NamedRoutes)
|
|
|
|
import Servant.Client (Client)
|
|
|
|
import Test.Hspec
|
2022-07-28 08:39:48 +03:00
|
|
|
import Test.QuerySpec.AggregatesSpec qualified
|
2022-04-10 07:47:15 +03:00
|
|
|
import Test.QuerySpec.BasicSpec qualified
|
2022-09-20 06:59:47 +03:00
|
|
|
import Test.QuerySpec.FilteringSpec qualified
|
2022-08-19 10:00:46 +03:00
|
|
|
import Test.QuerySpec.OrderBySpec qualified
|
2022-04-10 07:47:15 +03:00
|
|
|
import Test.QuerySpec.RelationshipsSpec qualified
|
|
|
|
import Prelude
|
|
|
|
|
2022-06-02 08:22:44 +03:00
|
|
|
spec :: Client IO (NamedRoutes Routes) -> SourceName -> Config -> Capabilities -> Spec
|
2022-08-19 10:00:46 +03:00
|
|
|
spec api sourceName config capabilities@Capabilities {..} = do
|
2022-04-10 07:47:15 +03:00
|
|
|
describe "query API" do
|
2022-06-02 08:22:44 +03:00
|
|
|
Test.QuerySpec.BasicSpec.spec api sourceName config
|
2022-09-20 06:59:47 +03:00
|
|
|
Test.QuerySpec.FilteringSpec.spec api sourceName config cComparisons
|
2022-08-19 10:00:46 +03:00
|
|
|
Test.QuerySpec.OrderBySpec.spec api sourceName config capabilities
|
2022-06-16 11:30:01 +03:00
|
|
|
when (isJust cRelationships) $
|
2022-09-20 06:59:47 +03:00
|
|
|
Test.QuerySpec.RelationshipsSpec.spec api sourceName config (cComparisons >>= _ccCrossTableComparisonCapabilities)
|
2022-08-16 07:45:07 +03:00
|
|
|
Test.QuerySpec.AggregatesSpec.spec api sourceName config cRelationships
|