diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 0e39fbe3aec..ab768922c13 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -7,6 +7,7 @@ - [Internal] Moved the request for push notification authorization after login [https://github.com/woocommerce/woocommerce-ios/pull/16428] - [Internal] Cleaned up logic for push notification token registration [https://github.com/woocommerce/woocommerce-ios/pull/16434] - [*] Fixed possible sync issue in POS (https://github.com/woocommerce/woocommerce-ios/pull/16423) +- [*] Enabled site troubleshooting for users authenticated with site credentials [https://github.com/woocommerce/woocommerce-ios/pull/16441] 23.8 ----- diff --git a/WooCommerce/Classes/ViewRelated/Connectivity Tool/ConnectivityToolViewModel.swift b/WooCommerce/Classes/ViewRelated/Connectivity Tool/ConnectivityToolViewModel.swift index 0daee2c642e..5120f3b7737 100644 --- a/WooCommerce/Classes/ViewRelated/Connectivity Tool/ConnectivityToolViewModel.swift +++ b/WooCommerce/Classes/ViewRelated/Connectivity Tool/ConnectivityToolViewModel.swift @@ -44,7 +44,14 @@ final class ConnectivityToolViewModel { /// private func startConnectivityTest(sinceTest: ConnectivityTest = .internetConnection) async { - for (index, testCase) in ConnectivityTest.allCases.enumerated().dropFirst(sinceTest.rawValue) { + let supportedTests: [ConnectivityTest] = { + if ServiceLocator.stores.isAuthenticatedWithoutWPCom == false { + [.internetConnection, .wpComServers, .site, .siteOrders] + } else { + [.internetConnection, .site, .siteOrders] + } + }() + for (index, testCase) in supportedTests.enumerated().dropFirst(sinceTest.rawValue) { // Add an inProgress card for the current test. cards.append(testCase.inProgressCard) @@ -265,7 +272,7 @@ private extension ConnectivityToolViewModel { case readMore = "arrow.up.forward.app" } - enum ConnectivityTest: Int, CaseIterable { + enum ConnectivityTest: Int { case internetConnection case wpComServers case site diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Settings/SettingsViewModel.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Settings/SettingsViewModel.swift index c85d6953834..b118dc67e1f 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Settings/SettingsViewModel.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Settings/SettingsViewModel.swift @@ -210,7 +210,6 @@ private extension SettingsViewModel { var rows: [Row] = [] if stores.isAuthenticated, - stores.isAuthenticatedWithoutWPCom == false, stores.sessionManager.defaultSite?.isWordPressComStore == false { rows.append(.connectivity) } diff --git a/WooCommerce/WooCommerceTests/ViewRelated/Settings/SettingsViewModelTests.swift b/WooCommerce/WooCommerceTests/ViewRelated/Settings/SettingsViewModelTests.swift index 01eb7b34352..634f905eeef 100644 --- a/WooCommerce/WooCommerceTests/ViewRelated/Settings/SettingsViewModelTests.swift +++ b/WooCommerce/WooCommerceTests/ViewRelated/Settings/SettingsViewModelTests.swift @@ -318,7 +318,7 @@ final class SettingsViewModelTests: XCTestCase { XCTAssertFalse(viewModel.sections.contains { $0.rows.contains(SettingsViewController.Row.connectivity) }) } - func test_sections_does_not_contain_connectivity_row_if_user_authenticated_without_wpcom() { + func test_sections_contains_connectivity_row_if_user_authenticated_without_wpcom() { let testSite = Site.fake().copy(siteID: 123, isJetpackThePluginInstalled: true, isJetpackConnected: true, isWordPressComStore: false) let stores = MockStoresManager(sessionManager: .makeForTesting(authenticated: true, isWPCom: false, defaultSite: testSite)) let viewModel = SettingsViewModel(stores: stores) @@ -327,7 +327,7 @@ final class SettingsViewModelTests: XCTestCase { viewModel.onViewDidLoad() // Then - XCTAssertFalse(viewModel.sections.contains { $0.rows.contains(SettingsViewController.Row.connectivity) }) + XCTAssertTrue(viewModel.sections.contains { $0.rows.contains(SettingsViewController.Row.connectivity) }) } func test_sections_contains_connectivity_row_if_user_authenticated_with_wpcom_to_non_wpcom_site() {