Start fixing flakey tests ❄️ (#3329)

* Wait longer on authentication flow tests.

* Move default perceptualPrecision value into the snapshot preferences.

* Delay snapshots *before* setting up the test.

* Reset the simulators on GitHub before running?

* Remove a test that is now handled by Rust.

* Fix a test that was yielding.
This commit is contained in:
Doug
2024-09-26 16:09:01 +01:00
committed by GitHub
parent 23ab453a1e
commit 4d7d687954
44 changed files with 138 additions and 153 deletions
@@ -113,11 +113,11 @@ class ComposerToolbarViewModelTests: XCTestCase {
XCTAssertEqual(viewModel.state.suggestions, suggestions)
}
func testSuggestionTrigger() async {
func testSuggestionTrigger() async throws {
let deferred = deferFulfillment(wysiwygViewModel.$attributedContent) { $0.plainText == "#not_implemented_yay" }
wysiwygViewModel.setMarkdownContent("@test")
wysiwygViewModel.setMarkdownContent("#not_implemented_yay")
await Task.yield()
try await deferred.fulfill()
// 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])