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

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

23 lines
702 B
Haskell
Raw Normal View History

{-# LANGUAGE QuasiQuotes #-}
module Hasura.Backends.DataConnector.API.V0.ScalarSpec (spec, genScalarType) where
import Data.Aeson.QQ.Simple (aesonQQ)
import Hasura.Backends.DataConnector.API.V0.Scalar
import Hasura.Generator.Common (defaultRange, genArbitraryAlphaNumTextExcluding)
import Hasura.Prelude
import Hedgehog
import Test.Aeson.Utils
import Test.Hspec
spec :: Spec
spec = do
describe "ScalarType" $ do
testToFromJSONToSchema (ScalarType "foo") [aesonQQ|"foo"|]
jsonOpenApiProperties genScalarType
genScalarType :: (MonadGen m, GenBase m ~ Identity) => m ScalarType
genScalarType =
ScalarType
<$> genArbitraryAlphaNumTextExcluding ["string", "number", "bool"] defaultRange