2022-03-31 07:45:03 +03:00
|
|
|
{-# LANGUAGE QuasiQuotes #-}
|
|
|
|
|
2022-10-20 06:23:37 +03:00
|
|
|
module Hasura.Backends.DataConnector.API.V0.ScalarSpec (spec, genScalarType) where
|
2022-03-31 07:45:03 +03:00
|
|
|
|
|
|
|
import Data.Aeson.QQ.Simple (aesonQQ)
|
2022-09-20 09:18:46 +03:00
|
|
|
import Hasura.Backends.DataConnector.API.V0.Scalar
|
2022-11-17 03:55:59 +03:00
|
|
|
import Hasura.Generator.Common (defaultRange, genArbitraryAlphaNumTextExcluding)
|
2022-03-31 07:45:03 +03:00
|
|
|
import Hasura.Prelude
|
|
|
|
import Hedgehog
|
|
|
|
import Test.Aeson.Utils
|
|
|
|
import Test.Hspec
|
|
|
|
|
|
|
|
spec :: Spec
|
|
|
|
spec = do
|
2022-10-20 06:23:37 +03:00
|
|
|
describe "ScalarType" $ do
|
2023-01-11 05:36:03 +03:00
|
|
|
testToFromJSONToSchema (ScalarType "foo") [aesonQQ|"foo"|]
|
2022-10-20 06:23:37 +03:00
|
|
|
jsonOpenApiProperties genScalarType
|
2022-03-31 07:45:03 +03:00
|
|
|
|
2022-11-17 03:55:59 +03:00
|
|
|
genScalarType :: (MonadGen m, GenBase m ~ Identity) => m ScalarType
|
2022-10-20 06:23:37 +03:00
|
|
|
genScalarType =
|
2023-01-11 05:36:03 +03:00
|
|
|
ScalarType
|
|
|
|
<$> genArbitraryAlphaNumTextExcluding ["string", "number", "bool"] defaultRange
|