mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Enable blank line rules. (#132)
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
import XCTest
|
||||
|
||||
class AttributedStringBuilderTests: XCTestCase {
|
||||
|
||||
let attributedStringBuilder = AttributedStringBuilder()
|
||||
let maxHeaderPointSize = ceil(UIFont.preferredFont(forTextStyle: .body).pointSize * 1.2)
|
||||
|
||||
@@ -370,7 +369,6 @@ class AttributedStringBuilderTests: XCTestCase {
|
||||
// MARK: - Private
|
||||
|
||||
private func checkMatrixEntityLinkIn(attributedString: AttributedString?, expected: String) {
|
||||
|
||||
guard let attributedString = attributedString else {
|
||||
XCTFail("Could not build the attributed string")
|
||||
return
|
||||
|
||||
@@ -11,7 +11,6 @@ import XCTest
|
||||
@testable import ElementX
|
||||
|
||||
class BackgroundTaskTests: XCTestCase {
|
||||
|
||||
private enum Constants {
|
||||
static let bgTaskName = "test"
|
||||
}
|
||||
@@ -155,11 +154,9 @@ class BackgroundTaskTests: XCTestCase {
|
||||
|
||||
XCTAssertNil(task, "Task should not be created")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private extension UIApplication {
|
||||
|
||||
static var mockHealty: ApplicationProtocol {
|
||||
MockApplication()
|
||||
}
|
||||
@@ -175,11 +172,9 @@ private extension UIApplication {
|
||||
backgroundTimeRemaining: 2,
|
||||
allowTasks: false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class MockApplication: ApplicationProtocol {
|
||||
|
||||
let applicationState: UIApplication.State
|
||||
let backgroundTimeRemaining: TimeInterval
|
||||
private let allowTasks: Bool
|
||||
@@ -223,5 +218,4 @@ private class MockApplication: ApplicationProtocol {
|
||||
}
|
||||
bgTasks.removeValue(forKey: identifier)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import Foundation
|
||||
import XCTest
|
||||
|
||||
class BugReportServiceTests: XCTestCase {
|
||||
|
||||
let bugReportService = MockBugReportService()
|
||||
|
||||
func testInitialStateWithMockService() {
|
||||
@@ -49,11 +48,9 @@ class BugReportServiceTests: XCTestCase {
|
||||
|
||||
XCTAssertEqual(result.reportUrl, "https://example.com/123")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class MockURLProtocol: URLProtocol {
|
||||
|
||||
override func startLoading() {
|
||||
let response = "{\"report_url\":\"https://example.com/123\"}"
|
||||
if let data = response.data(using: .utf8) {
|
||||
@@ -75,16 +72,13 @@ private class MockURLProtocol: URLProtocol {
|
||||
override class func canInit(with request: URLRequest) -> Bool {
|
||||
true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private extension URLSession {
|
||||
|
||||
static var mock: URLSession {
|
||||
let configuration = URLSessionConfiguration.default
|
||||
configuration.protocolClasses = [MockURLProtocol.self] + (configuration.protocolClasses ?? [])
|
||||
let result = URLSession(configuration: configuration)
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import XCTest
|
||||
|
||||
@MainActor
|
||||
class BugReportViewModelTests: XCTestCase {
|
||||
|
||||
func testInitialState() {
|
||||
let viewModel = BugReportViewModel(bugReportService: MockBugReportService(), screenshot: nil)
|
||||
let context = viewModel.context
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
import XCTest
|
||||
|
||||
class ElementXTests: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import XCTest
|
||||
@testable import ElementX
|
||||
|
||||
class HomeScreenViewModelTests: XCTestCase {
|
||||
|
||||
var viewModel: HomeScreenViewModelProtocol!
|
||||
var context: HomeScreenViewModelType.Context!
|
||||
|
||||
@@ -63,5 +62,4 @@ class HomeScreenViewModelTests: XCTestCase {
|
||||
await Task.yield()
|
||||
XCTAssert(correctResult)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ enum ImageAnonymizerTestsError: String, Error {
|
||||
}
|
||||
|
||||
class ImageAnonymizerTests: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
@@ -53,5 +52,4 @@ class ImageAnonymizerTests: XCTestCase {
|
||||
XCTAssertNotEqual(image, anonymizedRed)
|
||||
XCTAssertNotEqual(anonymizedBlue, anonymizedRed)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
import XCTest
|
||||
|
||||
class LocalizationTests: XCTestCase {
|
||||
|
||||
/// Test ElementL10n considers app language changes
|
||||
func testAppLanguage() {
|
||||
// set app language to English
|
||||
@@ -101,5 +100,4 @@ class LocalizationTests: XCTestCase {
|
||||
XCTAssertEqual(ElementL10n.untranslatedPlural(1), "One untranslated item")
|
||||
XCTAssertEqual(ElementL10n.untranslatedPlural(5), "5 untranslated items")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
import XCTest
|
||||
|
||||
class LoggingTests: XCTestCase {
|
||||
|
||||
private enum Constants {
|
||||
static let genericFailure = "Test failed"
|
||||
}
|
||||
@@ -92,5 +91,4 @@ class LoggingTests: XCTestCase {
|
||||
|
||||
XCTAssertTrue(logFile.contains(subLogName))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import Photos
|
||||
import XCTest
|
||||
|
||||
class ScreenshotDetectorTests: XCTestCase {
|
||||
|
||||
@MainActor func testDetection() async {
|
||||
async { expectation in
|
||||
let detector = ScreenshotDetector()
|
||||
@@ -59,5 +58,4 @@ class ScreenshotDetectorTests: XCTestCase {
|
||||
block(expectation)
|
||||
waiter.wait(for: [expectation], timeout: timeout)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import XCTest
|
||||
|
||||
@MainActor
|
||||
class SessionVerificationViewModelTests: XCTestCase {
|
||||
|
||||
var viewModel: SessionVerificationViewModelProtocol!
|
||||
var context: SessionVerificationViewModelType.Context!
|
||||
var sessionVerificationController: SessionVerificationControllerProxyProtocol!
|
||||
@@ -70,7 +69,6 @@ class SessionVerificationViewModelTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testAcceptChallenge() {
|
||||
|
||||
setupChallengeReceived()
|
||||
|
||||
let waitForAcceptance = XCTestExpectation(description: "Wait for acceptance")
|
||||
@@ -98,7 +96,6 @@ class SessionVerificationViewModelTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testDeclineChallenge() {
|
||||
|
||||
setupChallengeReceived()
|
||||
|
||||
let expectation = XCTestExpectation(description: "Wait for cancellation")
|
||||
|
||||
@@ -20,7 +20,6 @@ import XCTest
|
||||
|
||||
@MainActor
|
||||
class SettingsViewModelTests: XCTestCase {
|
||||
|
||||
var viewModel: SettingsViewModelProtocol!
|
||||
var context: SettingsViewModelType.Context!
|
||||
|
||||
@@ -66,5 +65,4 @@ class SettingsViewModelTests: XCTestCase {
|
||||
await Task.yield()
|
||||
XCTAssert(correctResult)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user