field_ios

In-the-field app for Radroots on iOS
git clone https://radroots.dev/git/field_ios.git
Log | Files | Refs | README | LICENSE

TeraRecoveryUITestSurface.swift (1250B)


      1 #if DEBUG
      2   import SwiftUI
      3 
      4   /// Runtime-free shell fixture using the same fact presentation and controls
      5   /// as Add and Drafts. It has no transport, credentials or durable authority.
      6   struct TeraRecoveryUITestSurface: View {
      7     @State private var editing = "Keep editing during recovery"
      8     @State private var scenario = 0
      9     @State private var checked = "none"
     10     private let key = String(repeating: "a", count: 64)
     11 
     12     var body: some View {
     13       Form {
     14         TextField("Editing", text: $editing).accessibilityIdentifier("tera.test.recovery.editing")
     15         Button("Next recovery state") { scenario = (scenario + 1) % 4 }
     16           .accessibilityIdentifier("tera.test.recovery.next")
     17         Text(checked).accessibilityIdentifier("tera.test.recovery.checked")
     18         TeraNativeRepairProgressView(message: pause?.message, remaining: 12)
     19         TeraNativeRepairActions(issue: .init(key: key, reason: scenario == 3 ? .associationMismatch : .outcomeUnconfirmed, status: nil),
     20                                 index: 0, isRunning: false) { checked = key }
     21       }
     22     }
     23 
     24     private var pause: TeraNativeRecoveryPause? {
     25       switch scenario {
     26       case 1: .protectedData
     27       case 2: .quota
     28       default: nil
     29       }
     30     }
     31   }
     32 #endif