Skip to content

Commit

Permalink
[NT-423] Remove hardcoded feature flag (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
Isabel Barrera committed Oct 25, 2019
1 parent 0c0faf2 commit 22466c1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
3 changes: 0 additions & 3 deletions Library/Extensions/Feature+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ public func featureNativeCheckoutIsEnabled() -> Bool {
}

public func featureNativeCheckoutPledgeViewIsEnabled() -> Bool {
// native checkout pledge view is currently not available in release builds
guard !AppEnvironment.current.mainBundle.isRelease else { return false }

return Feature.nativeCheckoutPledgeView.isEnabled()
}

Expand Down
39 changes: 0 additions & 39 deletions Library/Extensions/Feature+HelpersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,43 +56,4 @@ final class FeatureHelpersTests: TestCase {
XCTAssertFalse(featureNativeCheckoutPledgeViewIsEnabled())
}
}

func testFeatureNativeCheckoutPledgeViewEnabled_isFalse_ffIsFalse_inReleaseBuild() {
let testBundle = MockBundle.init(
bundleIdentifier: KickstarterBundleIdentifier.release.rawValue,
lang: "en"
)
let config = Config.template
|> \.features .~ [Feature.nativeCheckoutPledgeView.rawValue: false]

withEnvironment(config: config, mainBundle: testBundle) {
XCTAssertFalse(featureNativeCheckoutPledgeViewIsEnabled())
}
}

func testFeatureNativeCheckoutPledgeViewEnabled_isFalse_ffIsTrue_inReleaseBuild() {
let testBundle = MockBundle.init(
bundleIdentifier: KickstarterBundleIdentifier.release.rawValue,
lang: "en"
)
let config = Config.template
|> \.features .~ [Feature.nativeCheckoutPledgeView.rawValue: true]

withEnvironment(config: config, mainBundle: testBundle) {
XCTAssertFalse(featureNativeCheckoutPledgeViewIsEnabled())
}
}

func testFeatureNativeCheckoutPledgeViewEnabled_isFalse_ffIsNil_inReleaseBuild() {
let testBundle = MockBundle.init(
bundleIdentifier: KickstarterBundleIdentifier.release.rawValue,
lang: "en"
)
let config = Config.template
|> \.features .~ [:]

withEnvironment(config: config, mainBundle: testBundle) {
XCTAssertFalse(featureNativeCheckoutPledgeViewIsEnabled())
}
}
}

0 comments on commit 22466c1

Please sign in to comment.