updates for lock screen
This commit is contained in:
@@ -198,6 +198,26 @@ final class MockProtocol: URLProtocol, @unchecked Sendable {
|
||||
}
|
||||
await protection.updateScene(.active)
|
||||
check(!protection.locked, "Face ID success while system prompt is inactive unlocks the app")
|
||||
let presentation = AppModel()
|
||||
presentation.biometric = true; presentation.locked = true
|
||||
check(!presentation.unlockNeedsRetry, "Fresh protected launch shows branding instead of lock fallback")
|
||||
presentation.authenticate = { _ in
|
||||
check(!presentation.unlockNeedsRetry, "Face ID prompt keeps lock fallback hidden")
|
||||
throw LAError(.userCancel)
|
||||
}
|
||||
await presentation.updateScene(.active)
|
||||
check(presentation.locked && presentation.unlockNeedsRetry, "Only unsuccessful authentication shows the Unlock fallback")
|
||||
presentation.authenticate = { _ in
|
||||
check(!presentation.unlockNeedsRetry, "Retry returns to branded authentication screen")
|
||||
return true
|
||||
}
|
||||
await presentation.unlock()
|
||||
check(!presentation.locked && !presentation.unlockNeedsRetry, "Successful authentication opens app without lock screen")
|
||||
await presentation.updateScene(.background)
|
||||
check(!presentation.unlockNeedsRetry, "New background lock clears previous fallback state")
|
||||
presentation.authenticate = { _ in false }
|
||||
await presentation.updateScene(.active)
|
||||
check(presentation.locked && presentation.unlockNeedsRetry, "Incomplete authentication offers a retry instead of a permanent spinner")
|
||||
another.close(); transport.close(); print("\(checks) contract checks passed.")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user