feat: add v2 manifest bootstrap endpoints
This commit is contained in:
parent
4ebc04e1f4
commit
50735bb7cf
9 changed files with 408 additions and 4 deletions
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue