Skip to content
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

Update UpdateCardViewController copy #3570

Merged
merged 5 commits into from
May 17, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ class CustomerSheetUITest: XCTestCase {
XCTAssertTrue(app.pickerWheels.firstMatch.waitForExistence(timeout: timeout))
app.pickerWheels.firstMatch.swipeUp()
app.toolbars.buttons["Done"].tap()
app.buttons["Update card"].waitForExistenceAndTap(timeout: timeout)
app.buttons["Update"].waitForExistenceAndTap(timeout: timeout)

// We should have updated to Visa
XCTAssertTrue(app.images["carousel_card_visa"].waitForExistence(timeout: timeout))
Expand Down Expand Up @@ -1006,7 +1006,7 @@ class CustomerSheetUITest: XCTestCase {

// Should be able to edit CBC enabled PM even though it's the only one
XCTAssertTrue(app.buttons["CircularButton.Edit"].waitForExistenceAndTap(timeout: timeout))
XCTAssertTrue(app.buttons["Update card"].waitForExistence(timeout: timeout))
XCTAssertTrue(app.buttons["Update"].waitForExistence(timeout: timeout))

// ...but should not be able to remove it.
XCTAssertFalse(app.buttons["Remove card"].exists)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ class PaymentSheetStandardLPMUITests: PaymentSheetUITestCase {
XCTAssertTrue(app.pickerWheels.firstMatch.waitForExistence(timeout: 5))
app.pickerWheels.firstMatch.swipeUp()
app.toolbars.buttons["Done"].tap()
app.buttons["Update card"].waitForExistenceAndTap(timeout: 5)
app.buttons["Update"].waitForExistenceAndTap(timeout: 5)

// We should have updated to Visa
XCTAssertTrue(app.images["carousel_card_visa"].waitForExistence(timeout: 5))
Expand All @@ -1084,7 +1084,7 @@ class PaymentSheetStandardLPMUITests: PaymentSheetUITestCase {
XCTAssertTrue(app.pickerWheels.firstMatch.waitForExistence(timeout: 5))
app.pickerWheels.firstMatch.swipeDown()
app.toolbars.buttons["Done"].tap()
app.buttons["Update card"].waitForExistenceAndTap(timeout: 5)
app.buttons["Update"].waitForExistenceAndTap(timeout: 5)

// We should have updated to Cartes Bancaires
XCTAssertTrue(app.images["carousel_card_cartes_bancaires"].waitForExistence(timeout: 5))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ is not supported by the merchant */
/* An error message. */
"The IBAN you entered is invalid, \"%@\" is not a supported country code." = "The IBAN you entered is invalid, \"%@\" is not a supported country code.";

/* Title for a button that when tapped, presents a screen for updating a card. Also
the heading the screen itself. */
"Update card" = "Update card";
/* Title for a button that when tapped, updates a card brand. */
"Update" = "Update";

/* Title for a screen for updating a card brand. */
"Update card brand" = "Update card brand";

/* An error message. */
"Your IBAN should start with a two-letter country code." = "Your IBAN should start with a two-letter country code.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,17 @@ extension String.Localized {
STPLocalizedString("Back", "Text for back button")
}

static var update_card: String {
static var update_card_brand: String {
STPLocalizedString(
"Update card",
"""
Title for a button that when tapped, presents a screen for updating a card. Also
the heading the screen itself.
"""
"Update card brand",
"Title for a screen for updating a card brand."
)
}

static var update: String {
STPLocalizedString(
"Update",
"Title for a button that when tapped, updates a card brand."
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ final class UpdateCardViewController: UIViewController {

private lazy var headerLabel: UILabel = {
let label = PaymentSheetUI.makeHeaderLabel(appearance: appearance)
label.text = .Localized.update_card
label.text = .Localized.update_card_brand
return label
}()

private lazy var updateButton: ConfirmButton = {
return ConfirmButton(state: .disabled, callToAction: .custom(title: .Localized.update_card), appearance: appearance, didTap: { [weak self] in
return ConfirmButton(state: .disabled, callToAction: .custom(title: .Localized.update), appearance: appearance, didTap: { [weak self] in
Task {
await self?.updateCard()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class CircularButton: UIControl {
accessibilityIdentifier = "CircularButton.Remove"
case .edit:
imageView.image = Image.icon_edit.makeImage(template: true)
accessibilityLabel = String.Localized.update_card
accessibilityLabel = String.Localized.update_card_brand
accessibilityIdentifier = "CircularButton.Edit"
}
}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.