Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions integration/test/API/Galley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,37 @@ putAppLockSettings tid caller settings = do
req
)

data TeamProperties = TeamProperties
{ icon :: String,
iconKey :: String,
name :: String,
spashScreen :: String
}

instance Default TeamProperties where
def = TeamProperties "default" "default" "test" "default"

-- | https://staging-nginz-https.zinfra.io/v6/api/swagger-ui/#/default/put_teams__tid_
putTeamProperties ::
(HasCallStack, MakesValue tid, MakesValue caller) =>
tid ->
caller ->
TeamProperties ->
App Response
putTeamProperties tid caller properties = do
tidStr <- asString tid
req <- baseRequest caller Galley Versioned (joinHttpPath ["teams", tidStr])
submit
"PUT"
( addJSONObject
[ "icon" .= properties.icon,
"icon_key" .= properties.iconKey,
"name" .= properties.name,
"splash_screen" .= properties.spashScreen
]
req
)

-- | https://staging-nginz-https.zinfra.io/v5/api/swagger-ui/#/default/post_teams__tid__legalhold_settings
enableLegalHold :: (HasCallStack, MakesValue tid, MakesValue ownerid) => tid -> ownerid -> App Response
enableLegalHold tid ownerid = do
Expand Down
14 changes: 14 additions & 0 deletions integration/test/Test/TeamSettings.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,17 @@ testTeamSettingsUpdate = do
bindResponse (putAppLockSettings tid partner def) $ \resp -> do
resp.status `shouldMatchInt` 403
resp.json %. "label" `shouldMatch` "operation-denied"

testTeamPropertiesUpdate :: HasCallStack => App ()
testTeamPropertiesUpdate = do
(owner, tid, [mem]) <- createTeam OwnDomain 2
partner <- createTeamMemberWithRole owner tid "partner"

bindResponse (putTeamProperties tid owner def) $ \resp -> do
resp.status `shouldMatchInt` 200
bindResponse (putTeamProperties tid mem def) $ \resp -> do
resp.status `shouldMatchInt` 403
resp.json %. "label" `shouldMatch` "operation-denied"
bindResponse (putTeamProperties tid partner def) $ \resp -> do
resp.status `shouldMatchInt` 403
resp.json %. "label" `shouldMatch` "operation-denied"