mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Handle multithreaded access crashes on unit tests using generated mocks
- always dispatch receivedInvocations mutations on the main queue
This commit is contained in:
committed by
Stefan Ceriu
parent
8b3141ffec
commit
b8dea8ac4e
@@ -118,10 +118,12 @@ class ComposerToolbarViewModelTests: XCTestCase {
|
||||
XCTAssertEqual(viewModel.state.suggestions, suggestions)
|
||||
}
|
||||
|
||||
func testSuggestionTrigger() {
|
||||
func testSuggestionTrigger() async {
|
||||
wysiwygViewModel.setMarkdownContent("@test")
|
||||
wysiwygViewModel.setMarkdownContent("#not_implemented_yay")
|
||||
|
||||
await Task.yield()
|
||||
|
||||
// The first one is nil because when initialised the view model is empty
|
||||
XCTAssertEqual(completionSuggestionServiceMock.setSuggestionTriggerReceivedInvocations, [nil, .init(type: .user, text: "test", range: .init(location: 0, length: 5)), nil])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user