generated from coulomb/repo-seed
feat: add v2 manifest bootstrap endpoints
Some checks failed
Build and Deploy / build-push-deploy (push) Has been cancelled
Some checks failed
Build and Deploy / build-push-deploy (push) Has been cancelled
This commit is contained in:
13
Test/Main.hs
13
Test/Main.hs
@@ -9,6 +9,8 @@ import Web.Controller.Api.V2.InteractionEvents
|
||||
, metadataParamOrEmpty
|
||||
)
|
||||
import Web.Controller.Api.V2.Hubs (missingRequiredFields, validCreateHubKind)
|
||||
import Web.Controller.Api.V2.HubCapabilityManifests
|
||||
( jsonArrayTexts, textArrayFieldFromJsonBody )
|
||||
import Web.Controller.Api.V2.Widgets (missingWidgetCreateFields, validWidgetStatus)
|
||||
|
||||
main :: IO ()
|
||||
@@ -74,4 +76,15 @@ main = hspec do
|
||||
]
|
||||
`shouldBe` ["hubId", "widgetType"]
|
||||
|
||||
describe "API v2 manifest vocabulary parsing" do
|
||||
it "decodes declared vocabulary arrays from JSON request bodies" do
|
||||
textArrayFieldFromJsonBody
|
||||
"declaredPolicyScopes"
|
||||
(object ["declaredPolicyScopes" .= (["ops-internal", "ops-external"] :: [Text])])
|
||||
`shouldBe` Just ["ops-internal", "ops-external"]
|
||||
|
||||
it "extracts manifest-declared text arrays for activation" do
|
||||
jsonArrayTexts (toJSON (["ops-endpoint-card", "ops-alert-panel"] :: [Text]))
|
||||
`shouldBe` ["ops-endpoint-card", "ops-alert-panel"]
|
||||
|
||||
LayerBoundary.spec
|
||||
|
||||
Reference in New Issue
Block a user