Fix various flakey unit tests (#1783)

* Fix flakey emoji provider tests

* Fix flakey RoomScreenViewModel tests

* Fix flakey HomeScreenViewModel tests

* Fix flakey RoomMemberListScreen tests, problem with bindings getting overriden and deferFulfillment cancellable not getting stored

* Fix flakey RoomNotificationSettingsScreen tests and crashes

* Fix flakey RoomMemberDetailsScreen tests

* Deprecate old `deferFulfillment` and `nextViewState` methods

* Convert more files to the new `deferFulfillment`

* Converted the rest of the tests to the new deferFulfillment

* Removed now unused `nextViewState` and `deferFulfillment`

* Remove automatic retries from unit tests

* Reset analytics flag after running unit tests

* Address PR comments

* Introduce a new `deferFulfillment(publisher, keyPath, transitionValues)` method and use it where appropiate
This commit is contained in:
Stefan Ceriu
2023-09-26 13:28:29 +03:00
committed by GitHub
parent 1f3898c69d
commit a05c3e3774
27 changed files with 841 additions and 519 deletions
@@ -41,7 +41,7 @@ class EmojiPickerScreenViewModel: EmojiPickerScreenViewModelType, EmojiPickerScr
switch viewAction {
case let .search(searchString: searchString):
Task {
let categories = await emojiProvider.getCategories(searchString: searchString)
let categories = await emojiProvider.categories(searchString: searchString)
state.categories = convert(emojiCategories: categories)
}
case let .emojiTapped(emoji: emoji):
@@ -56,7 +56,7 @@ class EmojiPickerScreenViewModel: EmojiPickerScreenViewModelType, EmojiPickerScr
private func loadEmojis() {
Task(priority: .userInitiated) { [weak self] in
guard let self else { return }
let categories = await self.emojiProvider.getCategories(searchString: nil)
let categories = await self.emojiProvider.categories(searchString: nil)
self.state.categories = convert(emojiCategories: categories)
}
}