Skip to content

Commit

Permalink
Attempt to deflake testDarkMode (#4530)
Browse files Browse the repository at this point in the history
## Summary
Set the view's overrideUserInterfaceStyle to dark in addition to the
window

## Motivation
Attempt to deflake test

## Testing
running through CI.

## Changelog
<!-- Is this a notable change that affects users? If so, add a line to
`CHANGELOG.md` and prefix the line with one of the following:
    - [Added] for new features.
    - [Changed] for changes in existing functionality.
    - [Deprecated] for soon-to-be removed features.
    - [Removed] for now removed features.
    - [Fixed] for any bug fixes.
    - [Security] in case of vulnerabilities.
-->
  • Loading branch information
wooj-stripe authored Feb 3, 2025
1 parent 4ee641d commit af6a3c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ final class VerticalPaymentMethodListViewControllerSnapshotTest: STPSnapshotTest
}

func testDarkMode() {
let sut = VerticalPaymentMethodListViewController(initialSelection: .saved(paymentMethod: ._testCard()), savedPaymentMethod: ._testCard(), paymentMethodTypes: paymentMethods.map { .stripe($0) }, shouldShowApplePay: true, shouldShowLink: true, savedPaymentMethodAccessoryType: .edit, overrideHeaderView: nil, appearance: .default, currency: "USD", amount: 1099, incentive: nil, delegate: self)
// Fix testDarkMode: https://jira.corp.stripe.com/browse/RUN_MOBILESDK-3791
let paymentMethodsToTest = paymentMethods.filter({ $0 != .iDEAL && $0 != .cashApp && $0 != .bancontact })
let sut = VerticalPaymentMethodListViewController(initialSelection: .saved(paymentMethod: ._testCard()), savedPaymentMethod: ._testCard(), paymentMethodTypes: paymentMethodsToTest.map { .stripe($0) }, shouldShowApplePay: true, shouldShowLink: true, savedPaymentMethodAccessoryType: .edit, overrideHeaderView: nil, appearance: .default, currency: "USD", amount: 1099, incentive: nil, delegate: self)
let window = UIWindow()
window.isHidden = false
window.overrideUserInterfaceStyle = .dark
Expand Down
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 af6a3c2

Please sign in to comment.