-
Notifications
You must be signed in to change notification settings - Fork 995
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88dfa42
commit 7d44df9
Showing
5 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,9 +170,6 @@ re-entering the security code (CVV/CVC). */ | |
/* Disclaimer for when a promotion is available for paying with a bank account. e.g. 'Get $5 back when […]' */ | ||
"Get %@ back when you pay with your bank. <terms>See terms</terms>" = "Get %@ back when you pay with your bank. <terms>See terms</terms>"; | ||
|
||
/* Label for when the user is not eligible for a promo. e.g. 'No $5 promo' */ | ||
"No %@ promo" = "No %@ promo"; | ||
|
||
/* Bacs Debit mandate text */ | ||
"I understand that Stripe will be collecting Direct Debits on behalf of %@ and confirm that I am the account holder and the only person required to authorise debits from this account." = "I understand that Stripe will be collecting Direct Debits on behalf of %@ and confirm that I am the account holder and the only person required to authorise debits from this account."; | ||
|
||
|
@@ -215,6 +212,9 @@ re-entering the security code (CVV/CVC). */ | |
/* Title shown above a section containing payment methods that a customer can choose to pay with e.g. card, bank account, etc. */ | ||
"New payment method" = "New payment method"; | ||
|
||
/* Label for when the user is not eligible for a promo. */ | ||
"No %@ promo" = "No %@ promo"; | ||
|
||
/* Text of a label for confirming an email address. E.g., 'Not [email protected]?' */ | ||
"Not %@?" = "Not %@?"; | ||
|
||
|
65 changes: 65 additions & 0 deletions
65
...ePaymentSheet/StripePaymentSheetTests/PaymentSheet/BankAccountInfoViewSnapshotTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// BankAccountInfoViewSnapshotTests.swift | ||
// StripePaymentSheetTests | ||
// | ||
// Created by Till Hellmund on 12/17/24. | ||
// | ||
|
||
import StripeCoreTestUtils | ||
import UIKit | ||
@testable import StripePaymentSheet | ||
|
||
final class BankAccountInfoViewSnapshotTests : STPSnapshotTestCase { | ||
|
||
private static let frame = CGRect(x: 0, y: 0, width: 320, height: 1000) | ||
|
||
func test_noPromoBadge() { | ||
let view = BankAccountInfoView( | ||
frame: Self.frame, | ||
theme: .default, | ||
incentive: nil | ||
) | ||
view.setBankName(text: "Stripe Bank") | ||
view.setLastFourOfBank(text: "•••• 4242") | ||
view.setIncentiveEligible(false) | ||
|
||
verify(view) | ||
} | ||
|
||
func test_eligibleForPromo() { | ||
let view = BankAccountInfoView( | ||
frame: Self.frame, | ||
theme: .default, | ||
incentive: .init(identifier: "link_instant_debits", displayText: "$5") | ||
) | ||
view.setBankName(text: "Stripe Bank") | ||
view.setLastFourOfBank(text: "•••• 4242") | ||
view.setIncentiveEligible(true) | ||
|
||
verify(view) | ||
} | ||
|
||
func test_ineligibleForPromo() { | ||
let view = BankAccountInfoView( | ||
frame: Self.frame, | ||
theme: .default, | ||
incentive: .init(identifier: "link_instant_debits", displayText: "$5") | ||
) | ||
view.setBankName(text: "Stripe Bank") | ||
view.setLastFourOfBank(text: "•••• 4242") | ||
view.setIncentiveEligible(false) | ||
|
||
verify(view) | ||
} | ||
|
||
private func verify( | ||
_ view: UIView, | ||
identifier: String? = nil, | ||
file: StaticString = #filePath, | ||
line: UInt = #line | ||
) { | ||
view.backgroundColor = .white | ||
view.autosizeHeight(width: 300) | ||
STPSnapshotVerifyView(view, identifier: identifier, file: file, line: line) | ||
} | ||
} |
Binary file added
BIN
+15.2 KB
...PaymentSheetTests.BankAccountInfoViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.3 KB
...ymentSheetTests.BankAccountInfoViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.8 KB
...ripePaymentSheetTests.BankAccountInfoViewSnapshotTests/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.