Facebook advises testing your login flow and gives multiple test cases here. But for the life of me I can't figure out how to automate these. They seem to be written expected users to manually test these cases.
This code allows me to test things that are reliant on logging in. But not logging in itself...
func testLoginSuccess() {
// Inject mock
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.user = UserLoginSuccessMock()
let user = appDelegate.user!
user.Login()
XCTAssert(user.token != nil)
}
How to automate testing of facebook swift sdk login?