Skip to content

Commit

Permalink
Wrap snapshot tests in a BottomSheetViewController to show nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
porter-stripe committed May 13, 2024
1 parent deb23c0 commit fe7b63f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ final class VerticalSavedPaymentMethodsViewControllerSnapshotTests: STPSnapshotT
var configuration = PaymentSheet.Configuration()
configuration.appearance = appearance
let sut = VerticalSavedPaymentMethodsViewController(configuration: configuration, paymentMethods: generatePaymentMethods())
let bottomSheet = BottomSheetViewController(contentViewController: sut, appearance: appearance, isTestMode: true, didCancelNative3DS2: {})

let testWindow = UIWindow(frame: CGRect(x: 0, y: 0, width: 428, height: 500))
testWindow.isHidden = false
if darkMode {
testWindow.overrideUserInterfaceStyle = .dark
}
testWindow.rootViewController = sut
sut.view.autosizeHeight(width: 375)
STPSnapshotVerifyView(sut.view)
testWindow.rootViewController = bottomSheet
bottomSheet.view.autosizeHeight(width: 375, height: 400)
STPSnapshotVerifyView(bottomSheet.view)
}

private func generatePaymentMethods() -> [STPPaymentMethod] {
Expand Down
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.

0 comments on commit fe7b63f

Please sign in to comment.