Skip to content

Commit

Permalink
remove "hidden" text and update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
scottkicks committed Jun 14, 2023
1 parent 3d48b23 commit 15f79dc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class RemoteConfigFeatureFlagToolsViewControllerTests: TestCase {
RemoteConfigFeature.consentManagementDialogEnabled.rawValue: false,
RemoteConfigFeature.facebookLoginInterstitialEnabled
.rawValue: false,
RemoteConfigFeature.creatorDashboardHiddenEnabled
RemoteConfigFeature.creatorDashboardEnabled
.rawValue: false
]

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions Library/RemoteConfig/RemoteConfigFeature+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ public func featureConsentManagementDialogEnabled() -> Bool {
.isFeatureEnabled(featureKey: RemoteConfigFeature.consentManagementDialogEnabled) ?? false)
}

public func featureCreatorDashboardHiddenEnabled() -> Bool {
public func featureCreatorDashboardEnabled() -> Bool {
return AppEnvironment.current.userDefaults
.remoteConfigFeatureFlags[RemoteConfigFeature.creatorDashboardHiddenEnabled.rawValue] ??
.remoteConfigFeatureFlags[RemoteConfigFeature.creatorDashboardEnabled.rawValue] ??
(AppEnvironment.current.remoteConfigClient?
.isFeatureEnabled(featureKey: RemoteConfigFeature.creatorDashboardHiddenEnabled) ?? false)
.isFeatureEnabled(featureKey: RemoteConfigFeature.creatorDashboardEnabled) ?? false)
}

public func featureFacebookLoginInterstitialEnabled() -> Bool {
Expand Down
4 changes: 2 additions & 2 deletions Library/RemoteConfig/RemoteConfigFeature+HelpersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ final class RemoteConfigFeatureHelpersTests: TestCase {

func testCreatorDashboardHidden_RemoteConfig_FeatureFlag_False() {
let mockRemoteConfigClient = MockRemoteConfigClient()
|> \.features .~ [RemoteConfigFeature.creatorDashboardHiddenEnabled.rawValue: false]
|> \.features .~ [RemoteConfigFeature.creatorDashboardEnabled.rawValue: false]

withEnvironment(remoteConfigClient: mockRemoteConfigClient) {
XCTAssertFalse(featureCreatorDashboardHiddenEnabled())
XCTAssertFalse(featureCreatorDashboardEnabled())
}
}
}
4 changes: 2 additions & 2 deletions Library/RemoteConfig/RemoteConfigFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import Foundation

public enum RemoteConfigFeature: String, CaseIterable {
case consentManagementDialogEnabled = "consent_management_dialog"
case creatorDashboardHiddenEnabled = "creator_dashboard_hidden"
case creatorDashboardEnabled = "creator_dashboard"
case facebookLoginInterstitialEnabled = "facebook_interstitial"
}

extension RemoteConfigFeature: CustomStringConvertible {
public var description: String {
switch self {
case .consentManagementDialogEnabled: return "Consent Management Dialog"
case .creatorDashboardHiddenEnabled: return "Creator Dashboard Hidden"
case .creatorDashboardEnabled: return "Creator Dashboard"
case .facebookLoginInterstitialEnabled: return "Facebook Login Interstitial"
}
}
Expand Down
12 changes: 6 additions & 6 deletions Library/ViewModels/RemoteConfigFeatureFlagToolsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ private func isFeatureEnabled(_ feature: RemoteConfigFeature) -> Bool {
return featureConsentManagementDialogEnabled()
case .facebookLoginInterstitialEnabled:
return featureFacebookLoginInterstitialEnabled()
case .creatorDashboardHiddenEnabled:
return featureCreatorDashboardHiddenEnabled()
case .creatorDashboardEnabled:
return featureCreatorDashboardEnabled()
}
}

Expand All @@ -104,9 +104,9 @@ private func getValueFromUserDefaults(for feature: RemoteConfigFeature) -> Bool?
case .facebookLoginInterstitialEnabled:
return AppEnvironment.current.userDefaults
.remoteConfigFeatureFlags[RemoteConfigFeature.facebookLoginInterstitialEnabled.rawValue]
case .creatorDashboardHiddenEnabled:
case .creatorDashboardEnabled:
return AppEnvironment.current.userDefaults

Check warning on line 108 in Library/ViewModels/RemoteConfigFeatureFlagToolsViewModel.swift

View check run for this annotation

Codecov / codecov/patch

Library/ViewModels/RemoteConfigFeatureFlagToolsViewModel.swift#L108

Added line #L108 was not covered by tests
.remoteConfigFeatureFlags[RemoteConfigFeature.creatorDashboardHiddenEnabled.rawValue]
.remoteConfigFeatureFlags[RemoteConfigFeature.creatorDashboardEnabled.rawValue]
}
}

Expand All @@ -120,8 +120,8 @@ private func setValueInUserDefaults(for feature: RemoteConfigFeature, and value:
case .facebookLoginInterstitialEnabled:
return AppEnvironment.current.userDefaults
.remoteConfigFeatureFlags[RemoteConfigFeature.facebookLoginInterstitialEnabled.rawValue] = value
case .creatorDashboardHiddenEnabled:
case .creatorDashboardEnabled:
return AppEnvironment.current.userDefaults

Check warning on line 124 in Library/ViewModels/RemoteConfigFeatureFlagToolsViewModel.swift

View check run for this annotation

Codecov / codecov/patch

Library/ViewModels/RemoteConfigFeatureFlagToolsViewModel.swift#L124

Added line #L124 was not covered by tests
.remoteConfigFeatureFlags[RemoteConfigFeature.creatorDashboardHiddenEnabled.rawValue] = value
.remoteConfigFeatureFlags[RemoteConfigFeature.creatorDashboardEnabled.rawValue] = value
}
}

0 comments on commit 15f79dc

Please sign in to comment.