Skip to content

Commit

Permalink
Swap out a few more PNGs for SVGs (stripe#2989)
Browse files Browse the repository at this point in the history
## Summary
* Swap out a few more assets for their vector representations.
* Move PaymentSheet Example snapshot tests to the
StripePaymentSheetTests bundle to make it easier to re-run them.
* These tests didn't work outside of a host app (as view controller
presentation seems to be broken when running directly from xctest), so
reuse the StripeiOS tests host app for StripePaymentSheet's tests.
* Regenerate relevant snapshot tests.

## Testing
CI snapshots

## Changelog
None
  • Loading branch information
davidme-stripe authored Oct 30, 2023
1 parent 5ef525c commit 5b51075
Show file tree
Hide file tree
Showing 239 changed files with 847 additions and 245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ class PaymentSheetStandardLPMUITests: PaymentSheetUITestCase {
app.buttons["Present PaymentSheet"].waitForExistenceAndTap(timeout: 5)
// Saved card should show the cartes bancaires logo
XCTAssertTrue(app.staticTexts["••••1001"].waitForExistence(timeout: 5.0))
XCTAssertTrue(app.images["card_cartes_bancaires"].waitForExistence(timeout: 5))
XCTAssertTrue(app.images["carousel_card_cartes_bancaires"].waitForExistence(timeout: 5))

let editButton = app.staticTexts["Edit"]
XCTAssertTrue(editButton.waitForExistence(timeout: 60.0))
Expand Down
8 changes: 8 additions & 0 deletions Stripe/StripeiOSTests/STPImageLibraryTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ class STPImageLibraryTestSwift: XCTestCase {
}
}

func testUnpaddedImageForCardBrands() {
for brand in STPCardBrand.allCases {
let image = STPImageLibrary.unpaddedCardBrandImage(for: brand)
// Assert image exists
XCTAssert(image.size != .zero)
}
}

func testCVCImageForCardBrand() {
for brand in Self.cardBrands {
let image = STPImageLibrary.cvcImage(for: brand)
Expand Down
3 changes: 2 additions & 1 deletion StripePaymentSheet/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ let project = Project.stripeFramework(
],
includesSnapshots: true,
usesStubs: true
)
),
useHostedTestApp: true
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "discover_light.pdf",
"filename" : "carousel_applepay.svg",
"idiom" : "universal"
},
{
Expand All @@ -11,7 +11,7 @@
"value" : "dark"
}
],
"filename" : "discover_dark.pdf",
"filename" : "applePayDark.svg",
"idiom" : "universal"
}
],
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "americanExpressLight.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "americanExpressDark.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"filename" : "cartesBancairesLight.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "cartesBancairesDark.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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

0 comments on commit 5b51075

Please sign in to comment.