graphql-engine/server/src-test/Hasura/Backends/DataConnector/API/V0/SchemaSpec.hs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
732 B
Haskell
Raw Normal View History

{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE QuasiQuotes #-}
module Hasura.Backends.DataConnector.API.V0.SchemaSpec (spec) where
import Data.Aeson.QQ.Simple (aesonQQ)
import Hasura.Backends.DataConnector.API.V0.Schema
import Hasura.Backends.DataConnector.API.V0.TableSpec (genTableInfo)
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
testToFromJSONToSchema (SchemaResponse []) [aesonQQ|{"tables": []}|]
jsonOpenApiProperties genSchemaResponse
genSchemaResponse :: MonadGen m => m SchemaResponse
genSchemaResponse =
SchemaResponse <$> Gen.list (linear 0 5) genTableInfo