mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-21 22:41:43 +03:00
6586053296
> ## Description ✍️ - Creates a new `/capabilities` endpoint for the GDC agent API - Removes capabilities from the `/schema` endpoint - Removes the `/config-schema` endpoint and includes the `ConfigSchemaResponse` within the `CapabilitiesResponse` ### Related Issues ✍ -> https://hasurahq.atlassian.net/browse/GDW-85 PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4478 GitOrigin-RevId: 426662ee9e751343d94207d439a5025df65d2de7
19 lines
874 B
Haskell
19 lines
874 B
Haskell
module Test.CapabilitiesSpec (spec) where
|
|
|
|
import Hasura.Backends.DataConnector.API (Capabilities, CapabilitiesResponse (..), Config, Routes (..), validateConfigAgainstConfigSchema)
|
|
import Servant.API (NamedRoutes)
|
|
import Servant.Client (Client, (//))
|
|
import Test.Hspec (Spec, describe, it)
|
|
import Test.Hspec.Expectations.Pretty (shouldBe)
|
|
import Prelude
|
|
|
|
spec :: Client IO (NamedRoutes Routes) -> Config -> Capabilities -> Spec
|
|
spec api config expectedCapabilities = describe "capabilities API" $ do
|
|
it "returns the expected capabilities" $ do
|
|
CapabilitiesResponse capabilities _ <- api // _capabilities
|
|
capabilities `shouldBe` expectedCapabilities
|
|
|
|
it "returns a schema that can be used to validate the current config" $ do
|
|
CapabilitiesResponse _ configSchema <- api // _capabilities
|
|
validateConfigAgainstConfigSchema configSchema config `shouldBe` []
|