Skip to content

Commit

Permalink
Address flaky TapToPayEducationViewModelTests (#14873)
Browse files Browse the repository at this point in the history
  • Loading branch information
staskus authored Jan 16, 2025
2 parents 8fcf8f9 + 304a747 commit bf6e6c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ protocol BuiltInCardReaderMerchantEducationPresenting {
func presentMerchantEducation(completion: @escaping () -> Void)
}

final class BuiltInCardReaderMerchantEducationPresenter: BuiltInCardReaderMerchantEducationPresenting {
final class BuiltInCardReaderMerchantEducationPresenter: @preconcurrency BuiltInCardReaderMerchantEducationPresenting {
private weak var rootViewController: ViewControllerPresenting?

init(rootViewController: UIViewController) {
self.rootViewController = rootViewController
}

func presentMerchantEducation(completion: @escaping () -> Void) {
@MainActor func presentMerchantEducation(completion: @escaping () -> Void) {
let viewController = UIHostingController(rootView: TapToPayEducationView(viewModel: .init(completion: { _ in
completion()
})))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ enum TapToPayEducationResult {
case setUpTapToPay
}

@MainActor
final class TapToPayEducationViewModel: ObservableObject {
struct Action {
let title: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Testing
import Combine
@testable import WooCommerce

@MainActor
struct TapToPayEducationViewModelTests {
private let cardReaderSupportDeterminer: MockCardReaderSupportDeterminer

Expand Down

0 comments on commit bf6e6c8

Please sign in to comment.