diff --git a/Mail/Helpers/PreviewHelper.swift b/Mail/Helpers/PreviewHelper.swift index d35d07286..eea56293f 100644 --- a/Mail/Helpers/PreviewHelper.swift +++ b/Mail/Helpers/PreviewHelper.swift @@ -26,7 +26,7 @@ import SwiftUI enum PreviewHelper { class MockSelectedThreadOwner: SelectedThreadOwnable { - var selectedThread: Thread? = nil + var selectedThread: Thread? } static var mockSelectedThreadOwner = MockSelectedThreadOwner() diff --git a/MailCore/Cache/AccountManager/AccountManager.swift b/MailCore/Cache/AccountManager/AccountManager.swift index 55c968afb..069986bb3 100644 --- a/MailCore/Cache/AccountManager/AccountManager.swift +++ b/MailCore/Cache/AccountManager/AccountManager.swift @@ -468,7 +468,7 @@ public final class AccountManager: RefreshTokenDelegate, ObservableObject { logError(.missingAPIFetcher) return } - try await apiFetcher.detachMailbox(mailbox: mailbox) + _ = try await apiFetcher.detachMailbox(mailbox: mailbox) try await updateUser(for: currentAccount) } diff --git a/MailCore/Models/ComposeMessageIntent.swift b/MailCore/Models/ComposeMessageIntent.swift index cf738693d..3850554a1 100644 --- a/MailCore/Models/ComposeMessageIntent.swift +++ b/MailCore/Models/ComposeMessageIntent.swift @@ -41,7 +41,7 @@ public struct ComposeMessageIntent: Codable, Identifiable, Hashable { switch type { case .new(let fromExtension) where fromExtension: return true - case .mailTo(let mailToURLComponents): + case .mailTo: return true default: return false diff --git a/MailCore/Models/Draft.swift b/MailCore/Models/Draft.swift index 236e56495..95191529a 100644 --- a/MailCore/Models/Draft.swift +++ b/MailCore/Models/Draft.swift @@ -301,7 +301,7 @@ public extension Draft { public extension Draft { /// Compute if the draft has external recipients func displayExternalTag(mailboxManager: MailboxManager) -> DisplayExternalRecipientStatus.State { - var recipientsList = List() + let recipientsList = List() recipientsList.append(objectsIn: cc) recipientsList.append(objectsIn: bcc) recipientsList.append(objectsIn: to) @@ -370,7 +370,7 @@ public extension Draft { let itemsToExtract = removeAllElements ? Self.appendedHTMLElements : [Constants.signatureHTMLClass] for itemToExtract in itemsToExtract { - let _ = try? document.getElementsByClass(itemToExtract).remove() + _ = try? document.getElementsByClass(itemToExtract).remove() } return !document.hasText() diff --git a/MailCore/Utils/Constants.swift b/MailCore/Utils/Constants.swift index 95c5c012c..a32f8f98e 100644 --- a/MailCore/Utils/Constants.swift +++ b/MailCore/Utils/Constants.swift @@ -45,12 +45,12 @@ public enum DeeplinkConstants { } } -@MainActor public enum DesktopWindowIdentifier { public static let settingsWindowIdentifier = "settings" public static let composeWindowIdentifier = "compose" public static let threadWindowIdentifier = "thread" + @MainActor public static func mainWindowIdentifier(currentViewState: RootViewState) -> String { if case .mainView(let mainViewState) = currentViewState.state { return "Main-\(mainViewState.mailboxManager.mailbox.objectId)" diff --git a/MailCore/Utils/Logging.swift b/MailCore/Utils/Logging.swift index 56d3d3cd6..5edf673ff 100644 --- a/MailCore/Utils/Logging.swift +++ b/MailCore/Utils/Logging.swift @@ -119,7 +119,7 @@ public enum Logging { try FileManager.default.removeItem(at: fileURL) } } catch { - DDLogError(error) + DDLogError("resetAppForUITestsIfNeeded \(error)") } } #endif diff --git a/MailUITests/MailUITests.swift b/MailUITests/MailUITests.swift index 65a8c704f..ec1d6bbcc 100644 --- a/MailUITests/MailUITests.swift +++ b/MailUITests/MailUITests.swift @@ -29,10 +29,6 @@ class MailUITests: XCTestCase { continueAfterFailure = false } - override func tearDownWithError() throws { - try super.tearDownWithError() - } - func launchAppFromScratch(resetData: Bool = true) { if resetData { app.launchArguments += ["resetData"] @@ -181,7 +177,7 @@ class MailUITests: XCTestCase { func swipeFirstCell() { let testMailCell = app.collectionViews.cells.element(boundBy: 1) - let _ = testMailCell.waitForExistence(timeout: 10) + _ = testMailCell.waitForExistence(timeout: 10) testMailCell.firstMatch.swipeLeft() } @@ -212,12 +208,12 @@ class MailUITests: XCTestCase { app.buttons[MailResourcesStrings.Localizable.contentDescriptionButtonNext].firstMatch.tap() let loginButton = app.buttons[MailResourcesStrings.Localizable.buttonLogin].firstMatch - let _ = loginButton.waitForExistence(timeout: 2) + _ = loginButton.waitForExistence(timeout: 2) loginButton.tap() let loginWebview = app.webViews.firstMatch let emailField = loginWebview.textFields.firstMatch - let _ = emailField.waitForExistence(timeout: 5) + _ = emailField.waitForExistence(timeout: 5) emailField.tap() emailField.typeText(Env.testAccountEmail) @@ -229,14 +225,14 @@ class MailUITests: XCTestCase { let nextButton = app.buttons[MailResourcesStrings.Localizable.contentDescriptionButtonNext] let permissionApp = XCUIApplication(bundleIdentifier: "com.apple.springboard") - let _ = nextButton.waitForExistence(timeout: 3) + _ = nextButton.waitForExistence(timeout: 3) if nextButton.exists { nextButton.tap() permissionApp.alerts.firstMatch.buttons.firstMatch.tap() } - let _ = nextButton.waitForExistence(timeout: 3) + _ = nextButton.waitForExistence(timeout: 3) if nextButton.exists { app.buttons.firstMatch.tap()