diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dbeb42f082..172871c404d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ * Replaced uses of `UVerb` and `EmptyResult` with `MultiVerb` (#1693) * Added a mechanism to derive `AsUnion` instances automatically (#1693) +* Integration test coverage (#1704) # [2021-08-02] diff --git a/services/galley/test/integration/API/Teams/Feature.hs b/services/galley/test/integration/API/Teams/Feature.hs index 0010e85d767..a5faeabfe35 100644 --- a/services/galley/test/integration/API/Teams/Feature.hs +++ b/services/galley/test/integration/API/Teams/Feature.hs @@ -377,12 +377,20 @@ testSimpleFlag defaultValue = do setFlagInternal defaultValue getFlag defaultValue --- | Call 'GET /teams/:tid/features' and check if all features are there +-- | Call 'GET /teams/:tid/features' and 'GET /feature-configs', and check if all +-- features are there. testAllFeatures :: TestM () testAllFeatures = do (_owner, tid, member : _) <- Util.createBindingTeamWithNMembers 1 - let res = Util.getAllTeamFeatures member tid - res !!! do + Util.getAllTeamFeatures member tid !!! do + statusCode === const 200 + responseJsonMaybe === const (Just expected) + Util.getAllTeamFeaturesPersonal member !!! do + statusCode === const 200 + responseJsonMaybe === const (Just expected) + + randomPersonalUser <- Util.randomUser + Util.getAllTeamFeaturesPersonal randomPersonalUser !!! do statusCode === const 200 responseJsonMaybe === const (Just expected) where diff --git a/services/galley/test/integration/API/Util/TeamFeature.hs b/services/galley/test/integration/API/Util/TeamFeature.hs index 353f67b4d7f..ccdb769477d 100644 --- a/services/galley/test/integration/API/Util/TeamFeature.hs +++ b/services/galley/test/integration/API/Util/TeamFeature.hs @@ -106,6 +106,17 @@ getAllTeamFeatures uid tid = do . paths ["teams", toByteString' tid, "features"] . zUser uid +getAllTeamFeaturesPersonal :: + (HasCallStack, HasGalley m, MonadIO m, MonadHttp m) => + UserId -> + m ResponseLBS +getAllTeamFeaturesPersonal uid = do + g <- viewGalley + get $ + g + . paths ["feature-configs"] + . zUser uid + getTeamFeatureFlagWithGalley :: (MonadIO m, MonadHttp m, HasCallStack) => Public.TeamFeatureName -> (Request -> Request) -> UserId -> TeamId -> m ResponseLBS getTeamFeatureFlagWithGalley feature galley uid tid = do get $