Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ private extension SettingsViewModel {
var rows: [Row] = []

if stores.isAuthenticated,
stores.isAuthenticatedWithoutWPCom == false,
stores.sessionManager.defaultSite?.isWordPressComStore == false {
rows.append(.connectivity)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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() {
Expand Down