-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
RemoteConfigFeature+HelpersTests.swift
52 lines (42 loc) · 1.96 KB
/
RemoteConfigFeature+HelpersTests.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@testable import Library
import Prelude
import XCTest
final class RemoteConfigFeatureHelpersTests: TestCase {
func testConsentManagementDialog_RemoteConfig_FeatureFlag_False() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.consentManagementDialogEnabled.rawValue: false]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertFalse(featureConsentManagementDialogEnabled())
}
}
/** FIXME: RemoteConfigValue is not initializing because its' OBJC intiliazer is not available
func testConsentManagementDialog_RemoteConfig_FeatureFlag_True() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.consentManagementDialogEnabled.rawValue: true]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertTrue(featureConsentManagementDialogEnabled())
}
}
func testFacebookDeprecation_RemoteConfig_FeatureFlag_True() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.facebookLoginInterstitialEnabled.rawValue: true]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertTrue(featureFacebookLoginInterstitialEnabled())
}
}
*/
func testFacebookDeprecation_RemoteConfig_FeatureFlag_False() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.facebookLoginInterstitialEnabled.rawValue: false]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertFalse(featureFacebookLoginInterstitialEnabled())
}
}
func testCreatorDashboard_RemoteConfig_FeatureFlag_False() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.creatorDashboardEnabled.rawValue: false]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertFalse(featureCreatorDashboardEnabled())
}
}
}