8000 PM-17720: update check email screen by ezimet-livefront · Pull Request #1365 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PM-17720: update check email screen #1365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 20, 2025
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 @@ -7,7 +7,4 @@ enum CheckEmailAction: Equatable {

/// The go back button was tapped
case goBackTapped

/// The log in button was tapped
case logInTapped
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class CheckEmailProcessor: StateProcessor<CheckEmailState, CheckEmailAction, Voi

override func receive(_ action: CheckEmailAction) {
switch action {
case .logInTapped:
coordinator.navigate(to: .dismiss)
case .dismissTapped,
.goBackTapped:
coordinator.navigate(to: .dismissPresented)
Expand 10000 Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,4 @@ class CheckEmailProcessorTests: BitwardenTestCase {
subject.receive(.goBackTapped)
XCTAssertEqual(coordinator.routes.last, .dismissPresented)
}

/// `receive(_:)` with `.logInTapped` dismisses the view.
@MainActor
func test_receive_logInTapped() {
subject.receive(.logInTapped)
XCTAssertEqual(coordinator.routes.last, .dismiss)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ struct CheckEmailState: Equatable {

/// Text with user email in bold
var headelineTextBoldEmail: String {
Localizations.followTheInstructionsInTheEmailSentToXToContinueCreatingYourAccount("**\(email)**")
Localizations.weSentAnEmailTo("**\(email)**")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct CheckEmailView: View {
.padding(.vertical, 32)

Text(Localizations.checkYourEmail)
.styleGuide(.title2)
.styleGuide(.title2, weight: .semibold)
.multilineTextAlignment(.center)
.foregroundColor(Asset.Colors.textPrimary.swiftUIColor)
.frame(maxWidth: .infinity)
Expand All @@ -35,38 +35,32 @@ struct CheckEmailView: View {
Text(LocalizedStringKey(store.state.headelineTextBoldEmail))
.styleGuide(.headline)
.multilineTextAlignment(.center)
.padding(.bottom, 20)
.padding(.horizontal, 34)
.tint(Asset.Colors.textPrimary.swiftUIColor)
.foregroundColor(Asset.Colors.textPrimary.swiftUIColor)

Text(Localizations.selectTheLinkInTheEmailToVerifyYourEmailAddressAndContinueCreatingYourAccount)
.styleGuide(.headline)
.multilineTextAlignment(.center)
.padding(.bottom, 20)
.padding(.horizontal, 34)
.foregroundColor(Asset.Colors.textPrimary.swiftUIColor)

Button(Localizations.openEmailApp) {
openURL(URL(string: "message://")!)
}
.accessibilityIdentifier("OpenEmailAppButton")
.padding(.horizontal, 50)
.padding(.bottom, 32)
.padding(.bottom, 12)
.buttonStyle(.primary())

Text(LocalizedStringKey(Localizations.noEmailGoBackToEditYourEmailAddress))
.styleGuide(.subheadline)
.tint(Asset.Colors.textInteraction.swiftUIColor)
.foregroundColor(Asset.Colors.textPrimary.swiftUIColor)
.padding([.horizontal, .bottom], 32)
.environment(\.openURL, OpenURLAction { _ in
store.send(.goBackTapped)
return .handled
})

Text(LocalizedStringKey(Localizations.orLogInYouMayAlreadyHaveAnAccount))
.styleGuide(.subheadline)
.tint(Asset.Colors.textInteraction.swiftUIColor)
.foregroundColor(Asset.Colors.textPrimary.swiftUIColor)
.padding(.horizontal, 32)
.environment(\.openURL, OpenURLAction { _ in
store.send(.logInTapped)
return .handled
})
Button(Localizations.changeEmailAddress) {
store.send(.goBackTapped)
}
.accessibilityIdentifier("ChangeEmailAddressButton")
.padding(.horizontal, 50)
.padding(.bottom, 32)
.buttonStyle(.secondary())
}
}
.navigationBar(title: Localizations.createAccount, titleDisplayMode: .inline)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,25 @@ class CheckEmailViewTests: BitwardenTestCase {
XCTAssertEqual(processor.dispatchedActions.last, .dismissTapped)
}

/// Tapping the change email address button dispatches the `.goBackTapped` action.
@MainActor
func test_changeEmailAddressButton_tap() throws {
let button = try subject.inspect().find(button: Localizations.changeEmailAddress)
try button.tap()
XCTAssertEqual(processor.dispatchedActions.last, .goBackTapped)
}

// MARK: Snapshots

/// Tests the view renders correctly.
func test_snapshot_empty() {
assertSnapshots(of: subject, as: [.defaultPortrait, .defaultPortraitDark, .defaultPortraitAX5])
assertSnapshots(
of: subject,
as: [
.defaultPortrait,
.defaultPortraitDark,
.tallPortraitAX5(heightMultiple: 2),
]
)
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"BitwardenAppExtensionDescription" = "Use Bitwarden in Safari and other apps to autofill your logins.";
"BitwardenAutofillService" = "Bitwarden Autofill Service";
"BitwardenAutofillAccessibilityServiceDescription" = "Use the Bitwarden accessibility service to autofill your logins.";
"ChangeEmail" = "Change email";
"ChangeEmailAddress" = "Change email address";
"ChangeEmailConfirmation" = "You can change your email address on the bitwarden.com web vault. Do you want to visit the website now?";
"ChangeMasterPassword" = "Change master password";
"Close" = "Close";
Expand Down Expand Up @@ -923,7 +923,8 @@
"FilePasswordDescription" = "This password will be used to export and import this file";
"CreatingOn" = "Creating on";
"CheckYourEmail" = "Check your email";
"FollowTheInstructionsInTheEmailSentToXToContinueCreatingYourAccount" = "Follow the instructions in the email sent to %1$@ to continue creating your account.";
"WeSentAnEmailTo" = "We sent an email to %1$@";
"SelectTheLinkInTheEmailToVerifyYourEmailAddressAndContinueCreatingYourAccount" = "Select the link in the email to verify your email address and continue creating your account.";
"NoEmailGoBackToEditYourEmailAddress" = "No email? **[Go back](https://)** to edit your email address.";
"OrLogInYouMayAlreadyHaveAnAccount." = "Or **[log in](https://)**, you may already have an account.";
"OpenEmailApp" = "Open email app";
Expand Down
0