Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,19 @@ extension SignedInView: View {
.frame(maxWidth: .infinity)
.accessibilityIdentifier("update-password-button")

Button {
authService.navigator.push(.mfaManagement)
} label: {
Text(authService.string.manageTwoFactorAuthenticationLabel)
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
if authService.configuration.mfaEnabled {
Button {
authService.navigator.push(.mfaManagement)
} label: {
Text(authService.string.manageTwoFactorAuthenticationLabel)
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
}
.buttonStyle(.borderedProminent)
.padding([.top, .bottom], 8)
.frame(maxWidth: .infinity)
.accessibilityIdentifier("mfa-management-button")
}
.buttonStyle(.borderedProminent)
.padding([.top, .bottom], 8)
.frame(maxWidth: .infinity)
.accessibilityIdentifier("mfa-management-button")

Button {
showDeleteConfirmation = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ final class FirebaseSwiftUIExampleUITests: XCTestCase {
"SignedInView should be visible after login"
)

let mfaManagementButton = app.buttons["mfa-management-button"]
XCTAssertFalse(
mfaManagementButton.exists,
"MFA management button should be hidden when MFA is disabled"
)

dismissAlert(app: app)
// Check the Views are updated
let signOutButton = app.buttons["sign-out-button"]
Expand Down
Loading