Skip to content

Commit

Permalink
Fold guardComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
pcapriotti committed Jan 25, 2023
1 parent 88326ad commit 4b008d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions services/galley/test/integration/API/Federation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -838,10 +838,7 @@ sendMessage = do
connectWithRemoteUser aliceId bob
connectWithRemoteUser aliceId chad
-- conversation
let responses1 = do
comp <- frComponent <$> getRequest
guard (comp == Brig)
mockReply [bobProfile, chadProfile]
let responses1 = guardComponent Brig *> mockReply [bobProfile, chadProfile]
(convId, requests1) <-
withTempMockFederator' (responses1 <|> mockReply ()) $
fmap decodeConvId $
Expand Down
3 changes: 1 addition & 2 deletions services/galley/test/integration/API/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2746,8 +2746,7 @@ checkTimeout = 3 # Second
-- responses by Brig on the mocked side of federation.
mockedFederatedBrigResponse :: [(Qualified UserId, Text)] -> Mock LByteString
mockedFederatedBrigResponse users = do
comp <- frComponent <$> getRequest
guard (comp == Brig)
guardComponent Brig
mockReply [mkProfile mem (Name name) | (mem, name) <- users]

fedRequestsForDomain :: HasCallStack => Domain -> Component -> [FederatedRequest] -> [FederatedRequest]
Expand Down

0 comments on commit 4b008d3

Please sign in to comment.