[auth-payment-login-lockout] Unify auth back button and animate the flow entry
- RegistrationView / LoginEmailView / OtpView: pushed with no nav bar, so they showed the oversized iOS 26 system glass back button. Wrapped each in LCENavigationView with the standard AppBackButtonIcon, matching LoginView and every other screen. Dropped the now-dead colorScheme dark branches and forced .preferredColorScheme(.light) (app has no dark theme). - ContentView: root .auth <-> .main switched with no transition. Added .move transitions on both branches and wrapped enterAuthFlow() / LoginView's back action in withAnimation, so opening auth from Profile's 'Entrar ou Cadastrar' now slides in and back slides out. - ProfileLoggedOutFlowTests: new test asserting the pushed auth screens carry the LCENavigationView back button.
This commit is contained in:
@@ -40,4 +40,29 @@ final class ProfileLoggedOutFlowTests: XCTestCase {
|
||||
// Back out of `.auth` lands on the main tab bar again.
|
||||
XCTAssertTrue(app.buttons["Home"].waitForExistence(timeout: 5), "Back button did not return to the main flow")
|
||||
}
|
||||
|
||||
/// The pushed auth screens (Registration, LoginEmail) must carry the
|
||||
/// app's standard `AppBackButtonIcon` via `LCENavigationView`, not the
|
||||
/// oversized iOS 26 system glass back button.
|
||||
func testPushedAuthScreensUseAppBackButton() throws {
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
XCTAssertTrue(app.reachLoggedOutProfile())
|
||||
app.buttons["Entrar ou Cadastrar"].tap()
|
||||
|
||||
XCTAssertTrue(app.buttons["Criar conta"].waitForExistence(timeout: 5))
|
||||
app.buttons["Criar conta"].tap()
|
||||
XCTAssertTrue(app.staticTexts["Crie sua conta"].waitForExistence(timeout: 5))
|
||||
let regBack = app.buttons.matching(NSPredicate(format: "label == %@", "Back")).firstMatch
|
||||
XCTAssertTrue(regBack.exists, "Registration screen has no LCENavigationView back button")
|
||||
regBack.tap()
|
||||
|
||||
XCTAssertTrue(app.buttons["Entrar"].waitForExistence(timeout: 5))
|
||||
app.buttons["Entrar"].tap()
|
||||
XCTAssertTrue(app.staticTexts["Boas-vindas!"].waitForExistence(timeout: 5))
|
||||
let loginBack = app.buttons.matching(NSPredicate(format: "label == %@", "Back")).firstMatch
|
||||
XCTAssertTrue(loginBack.exists, "Login e-mail screen has no LCENavigationView back button")
|
||||
loginBack.tap()
|
||||
XCTAssertTrue(app.buttons["Criar conta"].waitForExistence(timeout: 5), "Back did not return to the auth intro")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user