I have a method I want to test it works perfectly fine on devices with iOS13 and above. Older versions, however, do not seem to verify the dismiss of an MFMailComposeViewController even if I debug and see it correctly execute the line of code.
My code will do something on the lines of this:
let dismissVerifier = DismissalVerifier()
let mailController = MFMailComposeViewController(rootViewController: sut)
let error = CustomError(title: "Test", description: "test")
sut.mailComposeController(mailController, didFinishWith: .sent, error: error)
dismissVerifier.verify(animated: true, dismissedViewController: mailController)
in my mailComposeController(mailController, didFinishWith: .sent, error: error) I will just set mailController to another variable then dismiss it.
I have a method I want to test it works perfectly fine on devices with iOS13 and above. Older versions, however, do not seem to verify the dismiss of an MFMailComposeViewController even if I debug and see it correctly execute the line of code.
My code will do something on the lines of this:
in my
mailComposeController(mailController, didFinishWith: .sent, error: error)
I will just setmailController
to another variable then dismiss it.