"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "services/galley/test/integration/API/Teams.hs" between
wire-server-2020-06-10.tar.gz and wire-server-2020-06-19.tar.gz

About: Wire (server) offers end-to-end encrypted messaging, file-sharing, video and voice calls, and guest rooms for external communication (back-end server).

Teams.hs  (wire-server-2020-06-10):Teams.hs  (wire-server-2020-06-19)
skipping to change at line 28 skipping to change at line 28
-- with this program. If not, see <https://www.gnu.org/licenses/>. -- with this program. If not, see <https://www.gnu.org/licenses/>.
module API.Teams module API.Teams
( tests, ( tests,
) )
where where
import API.SQS import API.SQS
import API.Util import API.Util
import qualified API.Util as Util import qualified API.Util as Util
import qualified API.Util.TeamFeature as Util
import Bilge hiding (timeout) import Bilge hiding (timeout)
import Bilge.Assert import Bilge.Assert
import qualified Brig.Types as Brig import qualified Brig.Types as Brig
import Control.Lens hiding ((#), (.=)) import Control.Lens hiding ((#), (.=))
import Control.Monad.Catch import Control.Monad.Catch
import Control.Retry import Control.Retry
import Data.Aeson hiding (json) import Data.Aeson hiding (json)
import Data.Aeson.Lens import Data.Aeson.Lens
import Data.ByteString.Conversion import Data.ByteString.Conversion
import Data.ByteString.Lazy (fromStrict) import Data.ByteString.Lazy (fromStrict)
skipping to change at line 60 skipping to change at line 61
import Galley.Options (optSettings, setEnableIndexedBillingTeamMembers, setFeatu reFlags, setMaxConvSize, setMaxFanoutSize) import Galley.Options (optSettings, setEnableIndexedBillingTeamMembers, setFeatu reFlags, setMaxConvSize, setMaxFanoutSize)
import Galley.Types hiding (EventData (..), EventType (..), MemberUpdate (..)) import Galley.Types hiding (EventData (..), EventType (..), MemberUpdate (..))
import qualified Galley.Types as Conv import qualified Galley.Types as Conv
import Galley.Types.Conversations.Roles import Galley.Types.Conversations.Roles
import Galley.Types.Teams import Galley.Types.Teams
import Galley.Types.Teams.Intra import Galley.Types.Teams.Intra
import Galley.Types.Teams.SearchVisibility import Galley.Types.Teams.SearchVisibility
import Gundeck.Types.Notification hiding (target) import Gundeck.Types.Notification hiding (target)
import Imports import Imports
import Network.HTTP.Types.Status (status403) import Network.HTTP.Types.Status (status403)
import qualified Network.Wai.Test as WaiTest
import qualified Network.Wai.Utilities.Error as Error import qualified Network.Wai.Utilities.Error as Error
import qualified Network.Wai.Utilities.Error as Wai import qualified Network.Wai.Utilities.Error as Wai
import qualified Proto.TeamEvents as E import qualified Proto.TeamEvents as E
import qualified Proto.TeamEvents_Fields as E import qualified Proto.TeamEvents_Fields as E
import Test.Tasty import Test.Tasty
import Test.Tasty.Cannon ((#), TimeoutUnit (..)) import Test.Tasty.Cannon ((#), TimeoutUnit (..))
import qualified Test.Tasty.Cannon as WS import qualified Test.Tasty.Cannon as WS
import Test.Tasty.HUnit import Test.Tasty.HUnit
import TestHelpers (test) import TestHelpers (test)
import TestSetup (TestM, TestSetup, tsBrig, tsCannon, tsGConf, tsGalley) import TestSetup (TestM, TestSetup, tsBrig, tsCannon, tsGConf, tsGalley)
skipping to change at line 131 skipping to change at line 131
-- Queue is emptied here to ensure that lingering events do not affect oth er tests -- Queue is emptied here to ensure that lingering events do not affect oth er tests
test s "team tests around truncation limits - no events, too large team" ( testTeamAddRemoveMemberAboveThresholdNoEvents >> ensureQueueEmpty), test s "team tests around truncation limits - no events, too large team" ( testTeamAddRemoveMemberAboveThresholdNoEvents >> ensureQueueEmpty),
test s "send billing events to owners even in large teams" testBillingInLa rgeTeam, test s "send billing events to owners even in large teams" testBillingInLa rgeTeam,
test s "send billing events to some owners in large teams (indexedBillingT eamMembers disabled)" testBillingInLargeTeamWithoutIndexedBillingTeamMembers, test s "send billing events to some owners in large teams (indexedBillingT eamMembers disabled)" testBillingInLargeTeamWithoutIndexedBillingTeamMembers,
test s "post crypto broadcast message json" postCryptoBroadcastMessageJson , test s "post crypto broadcast message json" postCryptoBroadcastMessageJson ,
test s "post crypto broadcast message json - filtered only, too large team " postCryptoBroadcastMessageJsonFilteredTooLargeTeam, test s "post crypto broadcast message json - filtered only, too large team " postCryptoBroadcastMessageJsonFilteredTooLargeTeam,
test s "post crypto broadcast message json (report missing in body)" postC ryptoBroadcastMessageJsonReportMissingBody, test s "post crypto broadcast message json (report missing in body)" postC ryptoBroadcastMessageJsonReportMissingBody,
test s "post crypto broadcast message protobuf" postCryptoBroadcastMessage Proto, test s "post crypto broadcast message protobuf" postCryptoBroadcastMessage Proto,
test s "post crypto broadcast message redundant/missing" postCryptoBroadca stMessageJson2, test s "post crypto broadcast message redundant/missing" postCryptoBroadca stMessageJson2,
test s "post crypto broadcast message no-team" postCryptoBroadcastMessageN oTeam, test s "post crypto broadcast message no-team" postCryptoBroadcastMessageN oTeam,
test s "post crypto broadcast message 100 (or max conns)" postCryptoBroadc test s "post crypto broadcast message 100 (or max conns)" postCryptoBroadc
astMessage100OrMaxConns, astMessage100OrMaxConns
test s "feature flags" testFeatureFlags
] ]
timeout :: WS.Timeout timeout :: WS.Timeout
timeout = 3 # Second timeout = 3 # Second
testCreateTeam :: TestM () testCreateTeam :: TestM ()
testCreateTeam = do testCreateTeam = do
c <- view tsCannon c <- view tsCannon
owner <- Util.randomUser owner <- Util.randomUser
WS.bracketR c owner $ \wsOwner -> do WS.bracketR c owner $ \wsOwner -> do
skipping to change at line 321 skipping to change at line 320
putSSOEnabledInternal tid Public.TeamFeatureEnabled putSSOEnabledInternal tid Public.TeamFeatureEnabled
check "Calling 'putEnabled True' should enable SSO" Public.TeamFeatureEnabled check "Calling 'putEnabled True' should enable SSO" Public.TeamFeatureEnabled
putSSOEnabledInternalCheckNotImplemented putSSOEnabledInternalCheckNotImplemented
testEnableTeamSearchVisibilityPerTeam :: TestM () testEnableTeamSearchVisibilityPerTeam :: TestM ()
testEnableTeamSearchVisibilityPerTeam = do testEnableTeamSearchVisibilityPerTeam = do
g <- view tsGalley g <- view tsGalley
(tid, owner, (member : _)) <- Util.createBindingTeamWithMembers 2 (tid, owner, (member : _)) <- Util.createBindingTeamWithMembers 2
let check :: (HasCallStack, MonadCatch m, MonadIO m, Monad m, MonadHttp m) => String -> Public.TeamFeatureStatus -> m () let check :: (HasCallStack, MonadCatch m, MonadIO m, Monad m, MonadHttp m) => String -> Public.TeamFeatureStatus -> m ()
check msg enabledness = do check msg enabledness = do
status <- responseJsonUnsafe <$> (getTeamSearchVisibilityAvailableIntern al g tid <!! testResponse 200 Nothing) status <- responseJsonUnsafe <$> (Util.getTeamSearchVisibilityAvailableI nternal g tid <!! testResponse 200 Nothing)
liftIO $ assertEqual msg enabledness status liftIO $ assertEqual msg enabledness status
let putSearchVisibilityCheckNotAllowed :: (HasCallStack, Monad m, MonadIO m, M onadHttp m) => m () let putSearchVisibilityCheckNotAllowed :: (HasCallStack, Monad m, MonadIO m, M onadHttp m) => m ()
putSearchVisibilityCheckNotAllowed = do putSearchVisibilityCheckNotAllowed = do
Wai.Error status label _ <- responseJsonUnsafe <$> putSearchVisibility g owner tid SearchVisibilityNoNameOutsideTeam Wai.Error status label _ <- responseJsonUnsafe <$> putSearchVisibility g owner tid SearchVisibilityNoNameOutsideTeam
liftIO $ do liftIO $ do
assertEqual "bad status" status403 status assertEqual "bad status" status403 status
assertEqual "bad label" "team-search-visibility-not-enabled" label assertEqual "bad label" "team-search-visibility-not-enabled" label
let getSearchVisibilityCheck :: (HasCallStack, MonadCatch m, MonadIO m, MonadH ttp m) => TeamSearchVisibility -> m () let getSearchVisibilityCheck :: (HasCallStack, MonadCatch m, MonadIO m, MonadH ttp m) => TeamSearchVisibility -> m ()
getSearchVisibilityCheck vis = getSearchVisibility g owner tid !!! do getSearchVisibilityCheck vis = getSearchVisibility g owner tid !!! do
const 200 === statusCode const 200 === statusCode
const (Just (TeamSearchVisibilityView vis)) === responseJsonUnsafe const (Just (TeamSearchVisibilityView vis)) === responseJsonUnsafe
withCustomSearchFeature FeatureTeamSearchVisibilityEnabledByDefault $ do Util.withCustomSearchFeature FeatureTeamSearchVisibilityEnabledByDefault $ do
check "Teams should start with Custom Search Visibility enabled" Public.Team FeatureEnabled check "Teams should start with Custom Search Visibility enabled" Public.Team FeatureEnabled
putSearchVisibility g owner tid SearchVisibilityNoNameOutsideTeam !!! const 204 === statusCode putSearchVisibility g owner tid SearchVisibilityNoNameOutsideTeam !!! const 204 === statusCode
putSearchVisibility g owner tid SearchVisibilityStandard !!! const 204 === s tatusCode putSearchVisibility g owner tid SearchVisibilityStandard !!! const 204 === s tatusCode
withCustomSearchFeature FeatureTeamSearchVisibilityDisabledByDefault $ do Util.withCustomSearchFeature FeatureTeamSearchVisibilityDisabledByDefault $ do
check "Teams should start with Custom Search Visibility disabled" Public.Tea mFeatureDisabled check "Teams should start with Custom Search Visibility disabled" Public.Tea mFeatureDisabled
putSearchVisibilityCheckNotAllowed putSearchVisibilityCheckNotAllowed
putTeamSearchVisibilityAvailableInternal g tid Public.TeamFeatureEnabled Util.putTeamSearchVisibilityAvailableInternal g tid Public.TeamFeatureEnabled
-- Nothing was set, default value -- Nothing was set, default value
getSearchVisibilityCheck SearchVisibilityStandard getSearchVisibilityCheck SearchVisibilityStandard
putSearchVisibility g owner tid SearchVisibilityNoNameOutsideTeam !!! testResp onse 204 Nothing putSearchVisibility g owner tid SearchVisibilityNoNameOutsideTeam !!! testResp onse 204 Nothing
getSearchVisibilityCheck SearchVisibilityNoNameOutsideTeam getSearchVisibilityCheck SearchVisibilityNoNameOutsideTeam
-- Check only admins can change the setting -- Check only admins can change the setting
putSearchVisibility g member tid SearchVisibilityStandard !!! testResponse 403 (Just "operation-denied") putSearchVisibility g member tid SearchVisibilityStandard !!! testResponse 403 (Just "operation-denied")
getSearchVisibilityCheck SearchVisibilityNoNameOutsideTeam getSearchVisibilityCheck SearchVisibilityNoNameOutsideTeam
-- Members can also see it? -- Members can also see it?
getSearchVisibility g member tid !!! testResponse 200 Nothing getSearchVisibility g member tid !!! testResponse 200 Nothing
-- Once we disable the feature, team setting is back to the default value -- Once we disable the feature, team setting is back to the default value
putTeamSearchVisibilityAvailableInternal g tid Public.TeamFeatureDisabled Util.putTeamSearchVisibilityAvailableInternal g tid Public.TeamFeatureDisabled
getSearchVisibilityCheck SearchVisibilityStandard getSearchVisibilityCheck SearchVisibilityStandard
testCreateOne2OneFailNonBindingTeamMembers :: TestM () testCreateOne2OneFailNonBindingTeamMembers :: TestM ()
testCreateOne2OneFailNonBindingTeamMembers = do testCreateOne2OneFailNonBindingTeamMembers = do
owner <- Util.randomUser owner <- Util.randomUser
let p1 = Util.symmPermissions [CreateConversation, DoNotUseDeprecatedAddRemove ConvMember] let p1 = Util.symmPermissions [CreateConversation, DoNotUseDeprecatedAddRemove ConvMember]
let p2 = Util.symmPermissions [CreateConversation, DoNotUseDeprecatedAddRemove ConvMember, AddTeamMember] let p2 = Util.symmPermissions [CreateConversation, DoNotUseDeprecatedAddRemove ConvMember, AddTeamMember]
mem1 <- newTeamMember' p1 <$> Util.randomUser mem1 <- newTeamMember' p1 <$> Util.randomUser
mem2 <- newTeamMember' p2 <$> Util.randomUser mem2 <- newTeamMember' p2 <$> Util.randomUser
Util.connectUsers owner (list1 (mem1 ^. userId) [mem2 ^. userId]) Util.connectUsers owner (list1 (mem1 ^. userId) [mem2 ^. userId])
skipping to change at line 1888 skipping to change at line 1887
(xxx, yyy, _, _) -> error ("Unexpected while connecting users: " ++ show xxx ++ " and " ++ show yyy) (xxx, yyy, _, _) -> error ("Unexpected while connecting users: " ++ show xxx ++ " and " ++ show yyy)
newTeamMember' :: Permissions -> UserId -> TeamMember newTeamMember' :: Permissions -> UserId -> TeamMember
newTeamMember' perms uid = newTeamMember uid perms Nothing newTeamMember' perms uid = newTeamMember uid perms Nothing
-- NOTE: all client functions calling @{/i,}/teams/*/features/*@ can be replaced by -- NOTE: all client functions calling @{/i,}/teams/*/features/*@ can be replaced by
-- hypothetical functions 'getTeamFeatureFlag', 'getTeamFeatureFlagInternal', -- hypothetical functions 'getTeamFeatureFlag', 'getTeamFeatureFlagInternal',
-- 'putTeamFeatureFlagInternal'. Since these functions all work in slightly dif ferent monads -- 'putTeamFeatureFlagInternal'. Since these functions all work in slightly dif ferent monads
-- and with different kinds of internal checks, it's quite tedious to do so. -- and with different kinds of internal checks, it's quite tedious to do so.
getSSOEnabled :: HasCallStack => UserId -> TeamId -> TestM ResponseLBS
getSSOEnabled uid tid = do
g <- view tsGalley
get $
g
. paths ["teams", toByteString' tid, "features", "sso"]
. zUser uid
getSSOEnabledInternal :: HasCallStack => TeamId -> TestM ResponseLBS getSSOEnabledInternal :: HasCallStack => TeamId -> TestM ResponseLBS
getSSOEnabledInternal tid = do getSSOEnabledInternal = Util.getTeamFeatureFlagInternal Public.TeamFeatureSSO
g <- view tsGalley
get $
g
. paths ["i", "teams", toByteString' tid, "features", "sso"]
putSSOEnabledInternal :: HasCallStack => TeamId -> Public.TeamFeatureStatus -> T estM () putSSOEnabledInternal :: HasCallStack => TeamId -> Public.TeamFeatureStatus -> T estM ()
putSSOEnabledInternal tid enabled = do putSSOEnabledInternal = Util.putTeamFeatureFlagInternal' Public.TeamFeatureSSO e
g <- view tsGalley xpect2xx
void . put $
g
. paths ["i", "teams", toByteString' tid, "features", "sso"]
. json enabled
. expect2xx
getSearchVisibility :: HasCallStack => (Request -> Request) -> UserId -> TeamId -> (MonadIO m, MonadHttp m) => m ResponseLBS getSearchVisibility :: HasCallStack => (Request -> Request) -> UserId -> TeamId -> (MonadIO m, MonadHttp m) => m ResponseLBS
getSearchVisibility g uid tid = do getSearchVisibility g uid tid = do
get $ get $
g g
. paths ["teams", toByteString' tid, "search-visibility"] . paths ["teams", toByteString' tid, "search-visibility"]
. zUser uid . zUser uid
putSearchVisibility :: HasCallStack => (Request -> Request) -> UserId -> TeamId -> TeamSearchVisibility -> (MonadIO m, MonadHttp m) => m ResponseLBS putSearchVisibility :: HasCallStack => (Request -> Request) -> UserId -> TeamId -> TeamSearchVisibility -> (MonadIO m, MonadHttp m) => m ResponseLBS
putSearchVisibility g uid tid vis = do putSearchVisibility g uid tid vis = do
put $ put $
g g
. paths ["teams", toByteString' tid, "search-visibility"] . paths ["teams", toByteString' tid, "search-visibility"]
. zUser uid . zUser uid
. json (TeamSearchVisibilityView vis) . json (TeamSearchVisibilityView vis)
getTeamSearchVisibilityAvailable :: HasCallStack => (Request -> Request) -> User
Id -> TeamId -> (MonadIO m, MonadHttp m) => m ResponseLBS
getTeamSearchVisibilityAvailable g uid tid = do
get $
g
. paths ["teams", toByteString' tid, "features", "search-visibility"]
. zUser uid
getTeamSearchVisibilityAvailableInternal :: HasCallStack => (Request -> Request)
-> TeamId -> (MonadIO m, MonadHttp m) => m ResponseLBS
getTeamSearchVisibilityAvailableInternal g tid = do
get $
g
. paths ["i", "teams", toByteString' tid, "features", "search-visibility"]
putTeamSearchVisibilityAvailableInternal :: HasCallStack => (Request -> Request)
-> TeamId -> Public.TeamFeatureStatus -> (MonadIO m, MonadHttp m) => m ()
putTeamSearchVisibilityAvailableInternal g tid status = do
void . put $
g
. paths ["i", "teams", toByteString' tid, "features", "search-visibility"]
. json status
. expect2xx
getLegalHoldEnabled :: HasCallStack => UserId -> TeamId -> TestM ResponseLBS
getLegalHoldEnabled uid tid = do
g <- view tsGalley
get $
g
. paths ["teams", toByteString' tid, "features", "legalhold"]
. zUser uid
getLegalHoldEnabledInternal :: HasCallStack => TeamId -> TestM ResponseLBS
getLegalHoldEnabledInternal tid = do
g <- view tsGalley
get $
g
. paths ["i", "teams", toByteString' tid, "features", "legalhold"]
putLegalHoldEnabledInternal :: HasCallStack => TeamId -> Public.TeamFeatureStatu
s -> TestM ()
putLegalHoldEnabledInternal = putLegalHoldEnabledInternal' expect2xx
putLegalHoldEnabledInternal' :: HasCallStack => (Request -> Request) -> TeamId -
> Public.TeamFeatureStatus -> TestM ()
putLegalHoldEnabledInternal' reqmod tid enabled = do
g <- view tsGalley
void . put $
g
. paths ["i", "teams", toByteString' tid, "features", "legalhold"]
. json enabled
. reqmod
testFeatureFlags :: TestM ()
testFeatureFlags = do
owner <- Util.randomUser
tid <- Util.createNonBindingTeam "foo" owner []
-- sso
let getSSO :: HasCallStack => Public.TeamFeatureStatus -> TestM ()
getSSO expected = getSSOEnabled owner tid !!! do
statusCode === const 200
responseJsonEither === const (Right expected)
getSSOInternal :: HasCallStack => Public.TeamFeatureStatus -> TestM ()
getSSOInternal expected = getSSOEnabledInternal tid !!! do
statusCode === const 200
responseJsonEither === const (Right expected)
setSSOInternal :: HasCallStack => Public.TeamFeatureStatus -> TestM ()
setSSOInternal = putSSOEnabledInternal tid
featureSSO <- view (tsGConf . optSettings . setFeatureFlags . flagSSO)
case featureSSO of
FeatureSSODisabledByDefault -> do
getSSO Public.TeamFeatureDisabled
getSSOInternal Public.TeamFeatureDisabled
setSSOInternal Public.TeamFeatureEnabled
getSSO Public.TeamFeatureEnabled
getSSOInternal Public.TeamFeatureEnabled
FeatureSSOEnabledByDefault -> do
-- since we don't allow to disable (see 'disableSsoNotImplemented'), we ca
n't test
-- much here. (disable failure is covered in "enable/disable SSO" above.)
getSSO Public.TeamFeatureEnabled
getSSOInternal Public.TeamFeatureEnabled
-- legalhold
let getLegalHold :: HasCallStack => Public.TeamFeatureStatus -> TestM ()
getLegalHold expected = getLegalHoldEnabled owner tid !!! do
statusCode === const 200
responseJsonEither === const (Right expected)
getLegalHoldInternal :: HasCallStack => Public.TeamFeatureStatus -> TestM
()
getLegalHoldInternal expected = getLegalHoldEnabledInternal tid !!! do
statusCode === const 200
responseJsonEither === const (Right expected)
setLegalHoldInternal :: HasCallStack => Public.TeamFeatureStatus -> TestM
()
setLegalHoldInternal = putLegalHoldEnabledInternal tid
getLegalHold Public.TeamFeatureDisabled
getLegalHoldInternal Public.TeamFeatureDisabled
-- FUTUREWORK: run two galleys, like below for custom search visibility.
featureLegalHold <- view (tsGConf . optSettings . setFeatureFlags . flagLegalH
old)
case featureLegalHold of
FeatureLegalHoldDisabledByDefault -> do
setLegalHoldInternal Public.TeamFeatureEnabled
getLegalHold Public.TeamFeatureEnabled
getLegalHoldInternal Public.TeamFeatureEnabled
FeatureLegalHoldDisabledPermanently -> do
putLegalHoldEnabledInternal' expect4xx tid Public.TeamFeatureEnabled
-- custom search visibility
g <- view tsGalley
let getTeamSearchVisibility ::
(Monad m, MonadHttp m, MonadIO m, MonadCatch m, HasCallStack) =>
TeamId ->
Public.TeamFeatureStatus ->
m ()
getTeamSearchVisibility teamid expected = getTeamSearchVisibilityAvailable
g owner teamid !!! do
statusCode === const 200
responseJsonEither === const (Right expected)
let getTeamSearchVisibilityInternal ::
(Monad m, MonadHttp m, MonadIO m, MonadCatch m, HasCallStack) =>
TeamId ->
Public.TeamFeatureStatus ->
m ()
getTeamSearchVisibilityInternal teamid expected = getTeamSearchVisibilityA
vailableInternal g teamid !!! do
statusCode === const 200
responseJsonEither === const (Right expected)
let setTeamSearchVisibilityInternal ::
(Monad m, MonadHttp m, MonadIO m, HasCallStack) =>
TeamId ->
Public.TeamFeatureStatus ->
m ()
setTeamSearchVisibilityInternal = putTeamSearchVisibilityAvailableInternal
g
tid2 <- Util.createNonBindingTeam "foo" owner []
withCustomSearchFeature FeatureTeamSearchVisibilityDisabledByDefault $ do
getTeamSearchVisibility tid2 Public.TeamFeatureDisabled
getTeamSearchVisibilityInternal tid2 Public.TeamFeatureDisabled
setTeamSearchVisibilityInternal tid2 Public.TeamFeatureEnabled
getTeamSearchVisibility tid2 Public.TeamFeatureEnabled
getTeamSearchVisibilityInternal tid2 Public.TeamFeatureEnabled
setTeamSearchVisibilityInternal tid2 Public.TeamFeatureDisabled
getTeamSearchVisibility tid2 Public.TeamFeatureDisabled
getTeamSearchVisibilityInternal tid2 Public.TeamFeatureDisabled
tid3 <- Util.createNonBindingTeam "foo" owner []
withCustomSearchFeature FeatureTeamSearchVisibilityEnabledByDefault $ do
getTeamSearchVisibility tid3 Public.TeamFeatureEnabled
getTeamSearchVisibilityInternal tid3 Public.TeamFeatureEnabled
setTeamSearchVisibilityInternal tid3 Public.TeamFeatureDisabled
getTeamSearchVisibility tid3 Public.TeamFeatureDisabled
getTeamSearchVisibilityInternal tid3 Public.TeamFeatureDisabled
setTeamSearchVisibilityInternal tid3 Public.TeamFeatureEnabled
getTeamSearchVisibility tid3 Public.TeamFeatureEnabled
getTeamSearchVisibilityInternal tid3 Public.TeamFeatureEnabled
checkJoinEvent :: (MonadIO m, MonadCatch m) => TeamId -> UserId -> WS.WebSocket -> m () checkJoinEvent :: (MonadIO m, MonadCatch m) => TeamId -> UserId -> WS.WebSocket -> m ()
checkJoinEvent tid usr w = WS.assertMatch_ timeout w $ \notif -> do checkJoinEvent tid usr w = WS.assertMatch_ timeout w $ \notif -> do
ntfTransient notif @?= False ntfTransient notif @?= False
let e = List1.head (WS.unpackPayload notif) let e = List1.head (WS.unpackPayload notif)
e ^. eventType @?= MemberJoin e ^. eventType @?= MemberJoin
e ^. eventTeam @?= tid e ^. eventTeam @?= tid
e ^. eventData @?= Just (EdMemberJoin usr) e ^. eventData @?= Just (EdMemberJoin usr)
withCustomSearchFeature :: FeatureTeamSearchVisibility -> WaiTest.Session () ->
TestM ()
withCustomSearchFeature flag action = do
opts <- view tsGConf
let opts' = opts & optSettings . setFeatureFlags . flagTeamSearchVisibility .~
flag
withSettingsOverrides opts' action
 End of changes. 13 change blocks. 
194 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)