Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f83f622
port sso tests
battermann May 24, 2024
f7ec882
legalhold tests and little cleanup
battermann May 24, 2024
e455d12
search visibility
battermann May 24, 2024
53c60aa
digital signatures
battermann May 24, 2024
4c3b6e0
ported all simple flag tests
battermann May 24, 2024
33da86f
guest link test
battermann May 24, 2024
679f783
ported more tests
battermann May 24, 2024
aeeab16
classified domains tests
battermann May 27, 2024
956a21f
all feature configs
battermann May 27, 2024
6118e76
test feature consistency
battermann May 27, 2024
c486b3c
self deleting messages
battermann May 27, 2024
3f8af5e
interal and public tests
battermann May 27, 2024
1242383
search visibility inbound
battermann May 27, 2024
fcdbfef
search visibility inbound multi
battermann May 27, 2024
27a4795
ttl overrides
battermann May 27, 2024
ba9a0bd
nix pacakges
battermann May 27, 2024
1601a1c
fix classified domains test
battermann May 28, 2024
d458219
removed two tests as the functionality is already fully covered by th…
battermann May 28, 2024
a26d9ba
mls test
battermann May 28, 2024
cc6a52a
enforce download location
battermann May 28, 2024
2f2c267
mls migration test
battermann May 28, 2024
9dbb9ce
removed redundant expose invitaion url tests
battermann May 28, 2024
f9cab9c
WIP: MLSE2EId test ported
May 28, 2024
4a6bed6
remove old test, little fixes
battermann May 28, 2024
fd8d732
search visibility, validate saml emails, and digital signatures patch
battermann May 28, 2024
52b3cb2
test patch AppLock
battermann May 28, 2024
e9de23c
add more patch tests
battermann May 29, 2024
ea77dcd
mlse2eid patch
battermann May 29, 2024
cf5b772
MLS patch
battermann May 29, 2024
7d3f72a
Add a changelog
May 29, 2024
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
1 change: 1 addition & 0 deletions changelog.d/5-internal/WPB-6442
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Port team feature tests to the `integration` package
1 change: 1 addition & 0 deletions integration/integration.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ library
Test.Errors
Test.ExternalPartner
Test.FeatureFlags
Test.FeatureFlags.Util
Test.Federation
Test.Federator
Test.LegalHold
Expand Down
11 changes: 11 additions & 0 deletions integration/test/API/Galley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -701,3 +701,14 @@ getTeamFeature user tid featureName = do
tidStr <- asString tid
req <- baseRequest user Galley Versioned (joinHttpPath ["teams", tidStr, "features", featureName])
submit "GET" req

setTeamFeatureConfig :: (HasCallStack, MakesValue user, MakesValue team, MakesValue featureName, MakesValue payload) => user -> team -> featureName -> payload -> App Response
setTeamFeatureConfig = setTeamFeatureConfigVersioned Versioned

setTeamFeatureConfigVersioned :: (HasCallStack, MakesValue user, MakesValue team, MakesValue featureName, MakesValue payload) => Versioned -> user -> team -> featureName -> payload -> App Response
setTeamFeatureConfigVersioned versioned user team featureName payload = do
tid <- asString team
fn <- asString featureName
p <- make payload
req <- baseRequest user Galley versioned $ joinHttpPath ["teams", tid, "features", fn]
submit "PUT" $ req & addJSON p
28 changes: 18 additions & 10 deletions integration/test/API/GalleyInternal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,11 @@ getTeamFeature domain_ tid featureName = do
req <- baseRequest domain_ Galley Unversioned $ joinHttpPath ["i", "teams", tid, "features", featureName]
submit "GET" $ req

setTeamFeatureStatus :: (HasCallStack, MakesValue domain, MakesValue team) => domain -> team -> String -> String -> App ()
setTeamFeatureStatus :: (HasCallStack, MakesValue domain, MakesValue team) => domain -> team -> String -> String -> App Response
setTeamFeatureStatus domain team featureName status = do
setTeamFeatureStatusExpectHttpStatus domain team featureName status 200

setTeamFeatureStatusExpectHttpStatus :: (HasCallStack, MakesValue domain, MakesValue team) => domain -> team -> String -> String -> Int -> App ()
setTeamFeatureStatusExpectHttpStatus domain team featureName status httpStatus = do
tid <- asString team
req <- baseRequest domain Galley Unversioned $ joinHttpPath ["i", "teams", tid, "features", featureName]
bindResponse (submit "PATCH" $ req & addJSONObject ["status" .= status]) $ \res -> do
res.status `shouldMatchInt` httpStatus
submit "PATCH" $ req & addJSONObject ["status" .= status]

setTeamFeatureLockStatus :: (HasCallStack, MakesValue domain, MakesValue team) => domain -> team -> String -> String -> App ()
setTeamFeatureLockStatus domain team featureName status = do
Expand Down Expand Up @@ -102,10 +97,23 @@ generateVerificationCode' domain email = do
emailStr <- asString email
submit "POST" $ req & addJSONObject ["email" .= emailStr, "action" .= "login"]

setTeamFeatureConfig :: (HasCallStack, MakesValue domain, MakesValue team, MakesValue featureName, MakesValue payload) => Versioned -> domain -> team -> featureName -> payload -> App Response
setTeamFeatureConfig versioned domain team featureName payload = do
setTeamFeatureConfig :: (HasCallStack, MakesValue domain, MakesValue team, MakesValue featureName, MakesValue payload) => domain -> team -> featureName -> payload -> App Response
setTeamFeatureConfig domain team featureName payload = do
tid <- asString team
fn <- asString featureName
p <- make payload
req <- baseRequest domain Galley versioned $ joinHttpPath ["teams", tid, "features", fn]
req <- baseRequest domain Galley Unversioned $ joinHttpPath ["i", "teams", tid, "features", fn]
submit "PUT" $ req & addJSON p

-- https://staging-nginz-https.zinfra.io/api-internal/swagger-ui/galley/#/galley/post_i_features_multi_teams_searchVisibilityInbound
getFeatureStatusMulti :: (HasCallStack, MakesValue domain, MakesValue featureName) => domain -> featureName -> [String] -> App Response
getFeatureStatusMulti domain featureName tids = do
fn <- asString featureName
req <- baseRequest domain Galley Unversioned $ joinHttpPath ["i", "features-multi-teams", fn]
submit "POST" $ req & addJSONObject ["teams" .= tids]

patchTeamFeature :: (HasCallStack, MakesValue domain, MakesValue team) => domain -> team -> String -> Value -> App Response
patchTeamFeature domain team featureName payload = do
tid <- asString team
req <- baseRequest domain Galley Unversioned $ joinHttpPath ["i", "teams", tid, "features", featureName]
submit "PATCH" $ req & addJSON payload
4 changes: 4 additions & 0 deletions integration/test/Notifications.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ isDeleteUserNotif :: MakesValue a => a -> App Bool
isDeleteUserNotif n =
nPayload n %. "type" `isEqual` "user.delete"

isFeatureConfigUpdateNotif :: MakesValue a => a -> App Bool
isFeatureConfigUpdateNotif n =
nPayload n %. "type" `isEqual` "feature-config.update"

isNewMessageNotif :: MakesValue a => a -> App Bool
isNewMessageNotif n = fieldEquals n "payload.0.type" "conversation.otr-message-add"

Expand Down
2 changes: 1 addition & 1 deletion integration/test/Test/Conversation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ testDeleteTeamMemberLimitedEventFanout = do

-- Only the team admins will get the team-level event about Alex being removed
-- from the team
setTeamFeatureStatus OwnDomain team "limitedEventFanout" "enabled"
assertSuccess =<< setTeamFeatureStatus OwnDomain team "limitedEventFanout" "enabled"

withWebSockets [alice, amy, bob, alison, ana] $
\[wsAlice, wsAmy, wsBob, wsAlison, wsAna] -> do
Expand Down
Loading