Skip to content

Commit

Permalink
Integrates some of the latest BSK changes (duckduckgo#1967)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1205381133187310/f

## Related PRs

BSK PR: duckduckgo/BrowserServicesKit#483
macOS PR: duckduckgo/macos-browser#1562

## Description

Integrates some of the latest changes from BSK.

--------

Co-authored-by: Sam Symons <sam@samsymons.com>
  • Loading branch information
diegoreymendez and samsymons authored Sep 3, 2023
1 parent 12df918 commit 2fe71d1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8874,7 +8874,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 75.3.0;
version = 75.3.1;
};
};
C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/DuckDuckGo/BrowserServicesKit",
"state": {
"branch": null,
"revision": "4fabb845513db67f47af428efcad6265fedaddf2",
"version": "75.3.0"
"revision": "28c24a730e17ff53bd461bf86b893b35fcf39c74",
"version": "75.3.1"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/NetworkProtectionRootViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ enum NetworkProtectionInitialViewKind {
final class NetworkProtectionRootViewModel: ObservableObject {
var initialViewKind: NetworkProtectionInitialViewKind

init(featureVisibility: NetworkProtectionFeatureVisibility = NetworkProtectionKeychainTokenStore()) {
initialViewKind = featureVisibility.isFeatureActivated ? .status : .invite
init(featureActivation: NetworkProtectionFeatureActivation = NetworkProtectionKeychainTokenStore()) {
initialViewKind = featureActivation.isFeatureActivated ? .status : .invite
}
}

Expand Down
14 changes: 7 additions & 7 deletions DuckDuckGoTests/NetworkProtectionRootViewModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ import NetworkProtection
final class NetworkProtectionRootViewModelTests: XCTestCase {

func test_initialViewKind_featureVisibilityFalse_isInvite() {
let featureVisibility = MockNetworkProtectionFeatureVisibility()
featureVisibility.isFeatureActivated = false
let viewModel = NetworkProtectionRootViewModel(featureVisibility: featureVisibility)
let featureActivation = MockNetworkProtectionFeatureActivation()
featureActivation.isFeatureActivated = false
let viewModel = NetworkProtectionRootViewModel(featureActivation: featureActivation)
XCTAssertEqual(viewModel.initialViewKind, .invite)
}

func test_initialViewKind_featureVisibilityTrue_isStatus() {
let featureVisibility = MockNetworkProtectionFeatureVisibility()
featureVisibility.isFeatureActivated = true
let viewModel = NetworkProtectionRootViewModel(featureVisibility: featureVisibility)
let featureActivation = MockNetworkProtectionFeatureActivation()
featureActivation.isFeatureActivated = true
let viewModel = NetworkProtectionRootViewModel(featureActivation: featureActivation)
XCTAssertEqual(viewModel.initialViewKind, .status)
}
}

final class MockNetworkProtectionFeatureVisibility: NetworkProtectionFeatureVisibility {
final class MockNetworkProtectionFeatureActivation: NetworkProtectionFeatureActivation {
var isFeatureActivated: Bool = false
}

0 comments on commit 2fe71d1

Please sign in to comment.