mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Remove the dynamic member lookup from UserSettings in favour of nested access. (#6294)
* Remove the dynamic member lookup from UserSettings in favour of nested access. * Remove forwarding methods from UserSettings. * Update the Enterprise submodule.
This commit is contained in:
@@ -45,12 +45,12 @@ final class JoinRoomScreenViewModelTests {
|
||||
|
||||
@Test
|
||||
func interaction() async throws {
|
||||
#expect(userSettings.seenInvites.isEmpty, "There shouldn't be any seen invites before running the tests.")
|
||||
#expect(userSettings.app.seenInvites.isEmpty, "There shouldn't be any seen invites before running the tests.")
|
||||
|
||||
setupViewModel()
|
||||
try await deferFulfillment(viewModel.context.$viewState) { $0.mode == .joinable }.fulfill()
|
||||
|
||||
#expect(userSettings.seenInvites.isEmpty, "Only an invited room should register the room ID as a seen invite.")
|
||||
#expect(userSettings.app.seenInvites.isEmpty, "Only an invited room should register the room ID as a seen invite.")
|
||||
|
||||
let deferred = deferFulfillment(viewModel.actionsPublisher) { $0 == .joined(.roomID("1")) }
|
||||
context.send(viewAction: .join)
|
||||
@@ -59,28 +59,28 @@ final class JoinRoomScreenViewModelTests {
|
||||
|
||||
@Test
|
||||
func acceptInviteInteraction() async throws {
|
||||
#expect(userSettings.seenInvites.isEmpty, "There shouldn't be any seen invites before running the tests.")
|
||||
#expect(userSettings.app.seenInvites.isEmpty, "There shouldn't be any seen invites before running the tests.")
|
||||
|
||||
setupViewModel(mode: .invited)
|
||||
try await deferFulfillment(viewModel.context.$viewState) { $0.mode == .invited(isDM: false) }.fulfill()
|
||||
|
||||
#expect(userSettings.seenInvites == ["1"], "The invited room's ID should be registered as a seen invite.")
|
||||
#expect(userSettings.app.seenInvites == ["1"], "The invited room's ID should be registered as a seen invite.")
|
||||
|
||||
let deferred = deferFulfillment(viewModel.actionsPublisher) { $0 == .joined(.roomID("1")) }
|
||||
context.send(viewAction: .acceptInvite)
|
||||
try await deferred.fulfill()
|
||||
|
||||
#expect(userSettings.seenInvites.isEmpty, "The after accepting an invite the invite should be forgotten in case the user leaves.")
|
||||
#expect(userSettings.app.seenInvites.isEmpty, "The after accepting an invite the invite should be forgotten in case the user leaves.")
|
||||
}
|
||||
|
||||
@Test
|
||||
func declineInviteInteraction() async throws {
|
||||
#expect(userSettings.seenInvites.isEmpty, "There shouldn't be any seen invites before running the tests.")
|
||||
#expect(userSettings.app.seenInvites.isEmpty, "There shouldn't be any seen invites before running the tests.")
|
||||
|
||||
setupViewModel(mode: .invited)
|
||||
|
||||
try await deferFulfillment(viewModel.context.$viewState) { $0.mode == .invited(isDM: false) }.fulfill()
|
||||
#expect(userSettings.seenInvites == ["1"], "The invited room's ID should be registered as a seen invite.")
|
||||
#expect(userSettings.app.seenInvites == ["1"], "The invited room's ID should be registered as a seen invite.")
|
||||
|
||||
context.send(viewAction: .declineInvite)
|
||||
|
||||
@@ -89,17 +89,17 @@ final class JoinRoomScreenViewModelTests {
|
||||
context.alertInfo?.secondaryButton?.action?()
|
||||
try await deferred.fulfill()
|
||||
|
||||
#expect(userSettings.seenInvites.isEmpty, "The after declining an invite the invite should be forgotten in case another invite is received.")
|
||||
#expect(userSettings.app.seenInvites.isEmpty, "The after declining an invite the invite should be forgotten in case another invite is received.")
|
||||
}
|
||||
|
||||
@Test
|
||||
func knockedState() async throws {
|
||||
#expect(userSettings.seenInvites.isEmpty, "There shouldn't be any seen invites before running the tests.")
|
||||
#expect(userSettings.app.seenInvites.isEmpty, "There shouldn't be any seen invites before running the tests.")
|
||||
setupViewModel(mode: .knocked)
|
||||
|
||||
try await deferFulfillment(viewModel.context.$viewState) { $0.mode == .knocked }.fulfill()
|
||||
|
||||
#expect(userSettings.seenInvites.isEmpty, "Only an invited room should register the room ID as a seen invite.")
|
||||
#expect(userSettings.app.seenInvites.isEmpty, "Only an invited room should register the room ID as a seen invite.")
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user