-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
RemoteConfigFeature+HelpersTests.swift
95 lines (75 loc) · 3.44 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@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())
}
}
func testConsentManagementDialog_RemoteConfig_FeatureFlag_True() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.consentManagementDialogEnabled.rawValue: true]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertTrue(featureConsentManagementDialogEnabled())
}
}
func testDarkMode_RemoteConfig_FeatureFlag_False() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.darkModeEnabled.rawValue: false]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertFalse(featureDarkModeEnabled())
}
}
func testDarkMode_RemoteConfig_FeatureFlag_True() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.darkModeEnabled.rawValue: true]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertTrue(featureDarkModeEnabled())
}
}
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 testReportThisProject_RemoteConfig_FeatureFlag_True() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.reportThisProjectEnabled.rawValue: true]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertTrue(featureReportThisProjectEnabled())
}
}
func testReportThisProject_RemoteConfig_FeatureFlag_False() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.reportThisProjectEnabled.rawValue: false]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertFalse(featureReportThisProjectEnabled())
}
}
func testUseOfAIProjectTab_RemoteConfig_FeatureFlag_False() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.useOfAIProjectTab.rawValue: false]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertFalse(featureUseOfAIProjectTabEnabled())
}
}
func testUseOfAIProjectTab_RemoteConfig_FeatureFlag_True() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.useOfAIProjectTab.rawValue: true]
withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertTrue(featureUseOfAIProjectTabEnabled())
}
}
}