mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 20:39:24 +00:00
Silence some warnings. (#4969)
This commit is contained in:
@@ -50,9 +50,8 @@ class DateTests: XCTestCase {
|
||||
XCTAssertEqual(threeDaysAgo.formattedDateSeparator(), threeDaysAgo.formatted(.dateTime.weekday(.wide)))
|
||||
|
||||
// This test will fail during the first 6 days of the year.
|
||||
let startOfTheYear = calendar.date(bySetting: .dayOfYear, value: 1, of: startOfToday)!
|
||||
// FIXME: Uncomment on the 7th Jan.
|
||||
// XCTAssertEqual(startOfTheYear.formattedDateSeparator(), startOfTheYear.formatted(.dateTime.weekday(.wide).day().month(.wide)))
|
||||
let startOfTheYear = calendar.dateInterval(of: .year, for: startOfToday)!.start
|
||||
XCTAssertEqual(startOfTheYear.formattedDateSeparator(), startOfTheYear.formatted(.dateTime.weekday(.wide).day().month(.wide)))
|
||||
|
||||
let theMillennium = calendar.date(from: DateComponents(year: 2000, month: 1, day: 1))!
|
||||
XCTAssertEqual(theMillennium.formattedDateSeparator(), theMillennium.formatted(.dateTime.weekday(.wide).day().month(.wide).year()))
|
||||
|
||||
@@ -34,7 +34,7 @@ class LoggingTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
try XCTAssertTrue(String(contentsOf: logFile).contains(infoLog))
|
||||
try XCTAssertTrue(String(contentsOf: logFile, encoding: .utf8).contains(infoLog))
|
||||
}
|
||||
|
||||
func testLogLevels() throws {
|
||||
@@ -48,7 +48,7 @@ class LoggingTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
try XCTAssertFalse(String(contentsOf: logFile).contains(verboseLog))
|
||||
try XCTAssertFalse(String(contentsOf: logFile, encoding: .utf8).contains(verboseLog))
|
||||
}
|
||||
|
||||
/// This is meant to test the `Target.tests.configure(…)`, but at this stage the test is somewhat pointless
|
||||
@@ -103,7 +103,7 @@ class LoggingTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
let content = try String(contentsOf: logFile)
|
||||
let content = try String(contentsOf: logFile, encoding: .utf8)
|
||||
XCTAssertTrue(content.contains(roomSummary.id))
|
||||
XCTAssertFalse(content.contains(roomName))
|
||||
XCTAssertFalse(content.contains(lastMessage))
|
||||
@@ -185,7 +185,7 @@ class LoggingTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
let content = try String(contentsOf: logFile)
|
||||
let content = try String(contentsOf: logFile, encoding: .utf8)
|
||||
XCTAssertTrue(content.contains(textMessage.id.uniqueID.value))
|
||||
XCTAssertFalse(content.contains(textMessage.body))
|
||||
XCTAssertFalse(content.contains(textAttributedString))
|
||||
@@ -254,7 +254,7 @@ class LoggingTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
let content = try String(contentsOf: logFile)
|
||||
let content = try String(contentsOf: logFile, encoding: .utf8)
|
||||
XCTAssertTrue(content.contains(String(describing: TextMessageContent.self)))
|
||||
XCTAssertFalse(content.contains(textString))
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ final class NotificationManagerTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
extension NotificationManagerTests: NotificationManagerDelegate {
|
||||
extension NotificationManagerTests: @MainActor NotificationManagerDelegate {
|
||||
func registerForRemoteNotifications() {
|
||||
authorizationStatusWasGranted = true
|
||||
registerForRemoteNotificationsDelegateCalled?()
|
||||
|
||||
@@ -98,7 +98,7 @@ class RoomDetailsEditScreenViewModelTests: XCTestCase {
|
||||
XCTAssertFalse(context.viewState.canSave)
|
||||
XCTAssertNil(context.alertInfo)
|
||||
|
||||
var deferred = deferFulfillment(viewModel.actions) { $0 == .cancel }
|
||||
let deferred = deferFulfillment(viewModel.actions) { $0 == .cancel }
|
||||
context.send(viewAction: .cancel)
|
||||
try await deferred.fulfill()
|
||||
XCTAssertNil(context.alertInfo)
|
||||
|
||||
Reference in New Issue
Block a user