Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceqin-stripe committed Jan 8, 2025
1 parent fceab86 commit c4802a0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Foundation
import UIKit

protocol SavedPaymentMethodFormFactoryDelegate: AnyObject {
func didUpdate(_: Element, didChange: Bool)
func didUpdate(_: Element, didUpdateCardBrand: Bool)
}

class SavedPaymentMethodFormFactory {
Expand Down Expand Up @@ -50,7 +50,7 @@ extension SavedPaymentMethodFormFactory: ElementDelegate {
func didUpdate(element: Element) {
switch viewModel.paymentMethod.type {
case .card:
delegate?.didUpdate(_: element, didChange: viewModel.selectedCardBrand != viewModel.paymentMethod.card?.preferredDisplayBrand)
delegate?.didUpdate(element, didUpdateCardBrand: viewModel.selectedCardBrand != viewModel.paymentMethod.card?.preferredDisplayBrand)
default:
break
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ extension UpdatePaymentMethodViewController: SheetNavigationBarDelegate {

// MARK: SavedPaymentMethodFormFactoryDelegate
extension UpdatePaymentMethodViewController: SavedPaymentMethodFormFactoryDelegate {
func didUpdate(_: Element, didChange: Bool) {
func didUpdate(_: Element, didUpdateCardBrand: Bool) {
latestError = nil // clear error on new input
switch viewModel.paymentMethod.type {
case .card:
updateCardBrand = didChange
updateCardBrand = didUpdateCardBrand
updateButton.update(state: updateCardBrand || updateDefaultPaymentMethod ? .enabled : .disabled)
default:
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class USBankAccountPaymentMethodElementTest: XCTestCase {
form.getTextFieldElement("Email").setText("foo@bar.com")
// Simulate customer setting up a linked bank account
form.linkedBank = FinancialConnectionsLinkedBank(sessionId: "123", accountId: "123", displayName: "Success", bankName: "StripeBank", last4: "6789", instantlyVerified: true)
XCTAssertEqual(form.getAllUnwrappedSubElements().count, 10)
XCTAssertEqual(form.getAllUnwrappedSubElements().count, 11)
XCTAssertNotNil(form.mandateString)
checkbox.isSelected = true

Expand Down
Binary file not shown.

0 comments on commit c4802a0

Please sign in to comment.