diff --git a/integration/test/API/Galley.hs b/integration/test/API/Galley.hs index ab692f3a1f..14123b112f 100644 --- a/integration/test/API/Galley.hs +++ b/integration/test/API/Galley.hs @@ -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 diff --git a/integration/test/Test/TeamSettings.hs b/integration/test/Test/TeamSettings.hs index 84e8cd920c..e820e57e25 100644 --- a/integration/test/Test/TeamSettings.hs +++ b/integration/test/Test/TeamSettings.hs @@ -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"