module Test.FeatureFlags.ClassifiedDomains where
import SetupHelpers
import Test.FeatureFlags.Util
import Testlib.Prelude
testClassifiedDomainsEnabled :: (HasCallStack) => App ()
testClassifiedDomainsEnabled :: HasCallStack => App ()
testClassifiedDomainsEnabled = do
(_, tid, m : _) <- Domain -> Int -> App (Value, String, [Value])
forall domain.
(HasCallStack, MakesValue domain) =>
domain -> Int -> App (Value, String, [Value])
createTeam Domain
OwnDomain Int
2
expected <- enabled & setField "config.domains" ["example.com"]
checkFeature "classifiedDomains" m tid expected
testClassifiedDomainsDisabled :: (HasCallStack) => App ()
testClassifiedDomainsDisabled :: HasCallStack => App ()
testClassifiedDomainsDisabled = do
ServiceOverrides -> (HasCallStack => String -> App ()) -> App ()
forall a.
HasCallStack =>
ServiceOverrides -> (HasCallStack => String -> App a) -> App a
withModifiedBackend ServiceOverrides
forall a. Default a => a
def {galleyCfg = setField "settings.featureFlags.classifiedDomains" (object ["status" .= "disabled", "config" .= object ["domains" .= ["example.com"]]])} ((HasCallStack => String -> App ()) -> App ())
-> (HasCallStack => String -> App ()) -> App ()
forall a b. (a -> b) -> a -> b
$ \String
domain -> do
(_, tid, m : _) <- String -> Int -> App (Value, String, [Value])
forall domain.
(HasCallStack, MakesValue domain) =>
domain -> Int -> App (Value, String, [Value])
createTeam String
domain Int
2
expected <- disabled & setField "config.domains" ["example.com"]
checkFeature "classifiedDomains" m tid expected