-
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
a66532f
commit b085346
Showing
7 changed files
with
70 additions
and
1 deletion.
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
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
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.
Binary file modified
BIN
-13 KB
(96%)
...etTests.VerticalPaymentMethodListViewControllerSnapshotTest/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.