Make LinkNewDeviceScreen fall back to the App Lock PIN code when there's no passcode. (#5794)

* Fall back to the AppLock PIN code when there's no passcode.

* Add extra tests on the LinkNewDeviceFlowCoordinator.

* Misc tweaks for clarification.

* Regenerate snapshots.
This commit is contained in:
Doug
2026-07-01 10:13:18 +01:00
committed by GitHub
parent 7097ceb910
commit 123661537a
38 changed files with 296 additions and 21 deletions
@@ -43,6 +43,19 @@ final class AppLockScreenViewModelTests {
#expect(result == .appUnlocked)
}
@Test
func cancelVerifyDeviceOwner() async throws {
// Given a screen shown to verify the device owner.
viewModel = AppLockScreenViewModel(appLockService: appLockService, mode: .verifyDeviceOwner)
// When the user cancels.
let deferred = deferFulfillment(viewModel.actions) { $0 == .cancelVerifyDeviceOwner }
viewModel.context.send(viewAction: .cancelVerifyDeviceOwner)
// Then the cancellation should be reported.
try await deferred.fulfill()
}
@Test
func forgotPIN() async throws {
// Given a fresh launch of the app.