Refactor UserSetting property wrapper to support Codable (#814)

* Add UserPreference property wrapper

* Delete UserSetting property wrapper

* Add PlistRepresentable support

* Add more convenience inits

* Add documentation

* Add UTs

* Fix flaky tests

* Fix more flaky tests

* Fix double optional problem in UserPreference

* Refine UTs

* Delete cache in UserPreference

* Conform Date to PlistRepresentable
This commit is contained in:
Alfonso Grillo
2023-04-21 12:46:04 +02:00
committed by GitHub
parent 1815b0a7ac
commit 4db6e68d79
7 changed files with 378 additions and 155 deletions
@@ -111,7 +111,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
func testIgnoreFailure() async throws {
let recipient = RoomMemberProxyMock.mockDan
recipient.ignoreUserClosure = {
try? await Task.sleep(for: .milliseconds(10))
try? await Task.sleep(for: .milliseconds(100))
return .failure(.ignoreUserFailed)
}
let mockedMembers: [RoomMemberProxyMock] = [.mockMe, recipient]
@@ -132,7 +132,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
func testUnignoreSuccess() async throws {
let recipient = RoomMemberProxyMock.mockIgnored
recipient.unignoreUserClosure = {
try? await Task.sleep(for: .milliseconds(10))
try? await Task.sleep(for: .milliseconds(100))
return .success(())
}
let mockedMembers: [RoomMemberProxyMock] = [.mockMe, recipient]