@@ -138,18 +138,6 @@ class FeedUIIntegrationTests: XCTestCase {
138138 assertThat ( sut, isRendering: [ image0] )
139139 }
140140
141- func test_loadFeedCompletion_dispatchesFromBackgroundToMainThread( ) {
142- let ( sut, loader) = makeSUT ( )
143- sut. simulateAppearance ( )
144-
145- let exp = expectation ( description: " Wait for background queue " )
146- DispatchQueue . global ( ) . async {
147- loader. completeFeedLoading ( at: 0 )
148- exp. fulfill ( )
149- }
150- wait ( for: [ exp] , timeout: 1.0 )
151- }
152-
153141 func test_loadFeedCompletion_rendersErrorMessageOnErrorUntilNextReload( ) {
154142 let ( sut, loader) = makeSUT ( )
155143
@@ -226,20 +214,6 @@ class FeedUIIntegrationTests: XCTestCase {
226214 XCTAssertFalse ( sut. isShowingLoadMoreFeedIndicator, " Expected no loading indicator once user initiated loading completes with error " )
227215 }
228216
229- func test_loadMoreCompletion_dispatchesFromBackgroundToMainThread( ) {
230- let ( sut, loader) = makeSUT ( )
231- sut. simulateAppearance ( )
232- loader. completeFeedLoading ( at: 0 )
233- sut. simulateLoadMoreFeedAction ( )
234-
235- let exp = expectation ( description: " Wait for background queue " )
236- DispatchQueue . global ( ) . async {
237- loader. completeLoadMore ( )
238- exp. fulfill ( )
239- }
240- wait ( for: [ exp] , timeout: 1.0 )
241- }
242-
243217 func test_loadMoreCompletion_rendersErrorMessageOnError( ) {
244218 let ( sut, loader) = makeSUT ( )
245219 sut. simulateAppearance ( )
@@ -546,21 +520,6 @@ class FeedUIIntegrationTests: XCTestCase {
546520 XCTAssertNil ( view? . renderedImage, " Expected no rendered image when an image load finishes after the view is not visible anymore " )
547521 }
548522
549- func test_loadImageDataCompletion_dispatchesFromBackgroundToMainThread( ) {
550- let ( sut, loader) = makeSUT ( )
551-
552- sut. simulateAppearance ( )
553- loader. completeFeedLoading ( with: [ makeImage ( ) ] )
554- _ = sut. simulateFeedImageViewVisible ( at: 0 )
555-
556- let exp = expectation ( description: " Wait for background queue " )
557- DispatchQueue . global ( ) . async {
558- loader. completeImageLoading ( with: self . anyImageData ( ) , at: 0 )
559- exp. fulfill ( )
560- }
561- wait ( for: [ exp] , timeout: 1.0 )
562- }
563-
564523 func test_feedImageView_doesNotLoadImageAgainUntilPreviousRequestCompletes( ) {
565524 let image = makeImage ( url: URL ( string: " http://url-0.com " ) !)
566525 let ( sut, loader) = makeSUT ( )
@@ -590,7 +549,7 @@ class FeedUIIntegrationTests: XCTestCase {
590549 // MARK: - Helpers
591550
592551 private func makeSUT(
593- selection: @escaping ( FeedImage ) -> Void = { _ in } ,
552+ selection: @MainActor @ escaping ( FeedImage ) -> Void = { _ in } ,
594553 file: StaticString = #filePath,
595554 line: UInt = #line
596555 ) -> ( sut: ListViewController , loader: LoaderSpy ) {
0 commit comments