File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed
FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views
samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExampleUITests Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,20 @@ public struct PasswordRecoveryView {
42
42
extension PasswordRecoveryView : View {
43
43
public var body : some View {
44
44
VStack {
45
+ HStack {
46
+ Button ( action: {
47
+ authService. authView = . authPicker
48
+ } ) {
49
+ HStack ( spacing: 4 ) {
50
+ Image ( systemName: " chevron.left " )
51
+ . font ( . system( size: 17 , weight: . medium) )
52
+ Text ( authService. string. backButtonLabel)
53
+ . font ( . system( size: 17 ) )
54
+ }
55
+ . foregroundColor ( . blue)
56
+ }
57
+ . accessibilityIdentifier ( " password-recovery-back-button " )
58
+ }
45
59
Text ( authService. string. passwordRecoveryTitle)
46
60
. font ( . largeTitle)
47
61
. fontWeight ( . bold)
@@ -79,14 +93,6 @@ extension PasswordRecoveryView: View {
79
93
. sheet ( item: $resultWrapper) { wrapper in
80
94
resultSheet ( wrapper. value)
81
95
}
82
- . navigationBarItems ( leading: Button ( action: {
83
- authService. authView = . authPicker
84
- } ) {
85
- Image ( systemName: " chevron.left " )
86
- . foregroundColor ( . blue)
87
- Text ( authService. string. backButtonLabel)
88
- . foregroundColor ( . blue)
89
- } . accessibilityIdentifier ( " password-recovery-back-button " ) )
90
96
}
91
97
92
98
@ViewBuilder
Original file line number Diff line number Diff line change @@ -354,7 +354,7 @@ final class MFAEnrollmentUITests: XCTestCase {
354
354
// MARK: - Navigation Tests
355
355
356
356
@MainActor
357
- func testCancelButtonNavigation ( ) throws {
357
+ func testBackButtonNavigation ( ) throws {
358
358
let app = XCUIApplication ( )
359
359
app. launchArguments. append ( " --auth-emulator " )
360
360
app. launchArguments. append ( " --mfa-enabled " )
@@ -367,10 +367,10 @@ final class MFAEnrollmentUITests: XCTestCase {
367
367
try signInToApp ( app: app, email: email)
368
368
try navigateToMFAEnrollment ( app: app)
369
369
370
- // Test cancel button exists
371
- let cancelButton = app. buttons [ " cancel -button" ]
372
- XCTAssertTrue ( cancelButton. exists, " Cancel button should exist" )
373
- XCTAssertTrue ( cancelButton. isEnabled, " Cancel button should be enabled" )
370
+ // Test back button exists
371
+ let cancelButton = app. buttons [ " mfa-back -button" ]
372
+ XCTAssertTrue ( cancelButton. exists, " Back button should exist" )
373
+ XCTAssertTrue ( cancelButton. isEnabled, " Back button should be enabled" )
374
374
375
375
// Tap cancel button
376
376
cancelButton. tap ( )
You can’t perform that action at this time.
0 commit comments