Skip to content

Commit 3022522

Browse files
committed
Add (failing) tests.
1 parent 98adbf9 commit 3022522

File tree

1 file changed

+24
-0
lines changed
  • services/galley/test/integration/API

1 file changed

+24
-0
lines changed

services/galley/test/integration/API/Teams.hs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,6 +1489,30 @@ testUpdateTeam = do
14891489
t <- Util.getTeam owner tid
14901490
liftIO $ assertEqual "teamSplashScreen" (t ^. teamSplashScreen) (fromByteString "3-1-e1c89a56-882e-4694-bab3-c4f57803c57a")
14911491

1492+
do
1493+
-- setting fields to `null` is the same as omitting the them from the update json record.
1494+
-- ("name" is set because a completely empty update object is rejected.)
1495+
doPut "{\"name\": \"new team name\", \"splash_screen\": null}" 200
1496+
t' <- Util.getTeam owner tid
1497+
liftIO $ assertEqual "teamSplashScreen" (t' ^. teamSplashScreen) (fromByteString "3-1-e1c89a56-882e-4694-bab3-c4f57803c57a")
1498+
1499+
do
1500+
-- setting splash screen to `"default"` won't parse as an Id.
1501+
doPut "{\"splash_screen\": \"default\"}" 400
1502+
1503+
do
1504+
-- use the `delete` end-point!
1505+
delete
1506+
( g
1507+
. paths ["teams", toByteString' tid, "splash_screen"]
1508+
. zUser owner
1509+
. zConn "conn"
1510+
)
1511+
!!! const 200
1512+
=== statusCode
1513+
t' <- Util.getTeam owner tid
1514+
liftIO $ assertEqual "teamSplashScreen" (t' ^. teamSplashScreen) Nothing
1515+
14921516
testTeamAddRemoveMemberAboveThresholdNoEvents :: HasCallStack => TestM ()
14931517
testTeamAddRemoveMemberAboveThresholdNoEvents = do
14941518
localDomain <- viewFederationDomain

0 commit comments

Comments
 (0)