2022-03-31 07:45:03 +03:00
|
|
|
{-# LANGUAGE OverloadedLists #-}
|
|
|
|
{-# LANGUAGE QuasiQuotes #-}
|
|
|
|
|
2022-05-02 08:03:12 +03:00
|
|
|
module Hasura.Backends.DataConnector.API.V0.SchemaSpec (spec) where
|
2022-03-31 07:45:03 +03:00
|
|
|
|
|
|
|
import Data.Aeson.QQ.Simple (aesonQQ)
|
2022-05-02 08:03:12 +03:00
|
|
|
import Hasura.Backends.DataConnector.API.V0.Schema
|
|
|
|
import Hasura.Backends.DataConnector.API.V0.TableSpec (genTableInfo)
|
2022-03-31 07:45:03 +03:00
|
|
|
import Hasura.Prelude
|
|
|
|
import Hedgehog
|
|
|
|
import Hedgehog.Gen qualified as Gen
|
|
|
|
import Hedgehog.Range
|
|
|
|
import Test.Aeson.Utils
|
|
|
|
import Test.Hspec
|
|
|
|
|
|
|
|
spec :: Spec
|
|
|
|
spec = do
|
|
|
|
describe "SchemaResponse" $ do
|
2022-06-03 11:06:31 +03:00
|
|
|
testToFromJSONToSchema (SchemaResponse []) [aesonQQ|{"tables": []}|]
|
2022-03-31 07:45:03 +03:00
|
|
|
jsonOpenApiProperties genSchemaResponse
|
|
|
|
|
|
|
|
genSchemaResponse :: MonadGen m => m SchemaResponse
|
|
|
|
genSchemaResponse =
|
2022-06-03 11:06:31 +03:00
|
|
|
SchemaResponse <$> Gen.list (linear 0 5) genTableInfo
|