Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default playground & example app layout from horizontal to automatic #4424

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ struct PaymentSheetTestPlaygroundSettings: Codable, Equatable {
static func defaultValues() -> PaymentSheetTestPlaygroundSettings {
return PaymentSheetTestPlaygroundSettings(
uiStyle: .paymentSheet,
layout: .horizontal,
layout: .automatic,
mode: .payment,
customerKeyType: .legacy,
integrationType: .normal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class PaymentSheet_AddressTests: XCTestCase {

func testManualAddressEntry() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.uiStyle = .flowController
settings.shippingInfo = .on

Expand Down Expand Up @@ -96,6 +97,7 @@ US

func testAddressWithDefaults() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.shippingInfo = .onWithDefaults
settings.uiStyle = .flowController

Expand Down Expand Up @@ -132,6 +134,7 @@ US

func testAddressAutoComplete_UnitedStates() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.uiStyle = .flowController
loadPlayground(
app,
Expand Down Expand Up @@ -187,6 +190,7 @@ US
/// This test ensures we don't show auto complete for an unsupported country
func testAddressAutoComplete_NewZeland() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.uiStyle = .flowController
loadPlayground(
app,
Expand Down Expand Up @@ -251,6 +255,7 @@ NZ
func testPaymentSheetFlowControllerUpdatesShipping() {

var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.applePayEnabled = .off
settings.apmsEnabled = .off
settings.linkPassthroughMode = .passthrough
Expand Down Expand Up @@ -340,6 +345,7 @@ NZ
func testManualAddressEntry_phoneCountryDoesPersist() throws {

var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.uiStyle = .flowController
loadPlayground(
app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class PaymentSheetBillingCollectionUICardTests: PaymentSheetBillingCollectionUIT
func testCard_AllFields_flowController_WithDefaults() throws {

var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .guest
settings.uiStyle = .flowController
settings.currency = .usd
Expand Down Expand Up @@ -111,6 +112,7 @@ class PaymentSheetBillingCollectionLPMUITests: PaymentSheetBillingCollectionUITe
func testLpm_Afterpay_AutomaticFields_WithDefaultAddress() throws {

var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .guest
settings.merchantCountryCode = .US
settings.currency = .usd
Expand Down Expand Up @@ -175,6 +177,7 @@ class PaymentSheetBillingCollectionLPMUITests: PaymentSheetBillingCollectionUITe

func testLpm_Afterpay_AllFields_WithDefaults() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .guest
settings.currency = .usd
settings.merchantCountryCode = .US
Expand Down Expand Up @@ -230,6 +233,7 @@ class PaymentSheetBillingCollectionLPMUITests: PaymentSheetBillingCollectionUITe

func testLpm_Afterpay_MinimalFields_WithDefaults() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .guest
settings.currency = .usd
settings.merchantCountryCode = .US
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import XCTest
class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {
func testEPS() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.applePayEnabled = .off
settings.currency = .eur
Expand All @@ -32,6 +33,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testP24() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.applePayEnabled = .off
settings.currency = .eur
Expand Down Expand Up @@ -68,6 +70,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {
// Klarna has a text field and country drop down
func testKlarnaPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new // new customer
settings.apmsEnabled = .off
loadPlayground(app, settings)
Expand Down Expand Up @@ -99,6 +102,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testAffirmPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.apmsEnabled = .off
loadPlayground(app, settings)
Expand All @@ -116,6 +120,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testAmazonPayPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.apmsEnabled = .off
loadPlayground(app, settings)
Expand All @@ -133,6 +138,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testAlmaPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.currency = .eur
settings.merchantCountryCode = .FR
settings.customerMode = .new
Expand All @@ -151,6 +157,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testSunbitPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.currency = .usd
settings.amount = ._10000
settings.merchantCountryCode = .US
Expand All @@ -168,6 +175,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testBilliePaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.currency = .eur
settings.merchantCountryCode = .DE
loadPlayground(app, settings)
Expand All @@ -184,6 +192,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testSatispayPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.currency = .eur
settings.merchantCountryCode = .IT
loadPlayground(app, settings)
Expand All @@ -200,6 +209,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testZipPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new // new customer
settings.apmsEnabled = .off
settings.currency = .aud
Expand All @@ -219,6 +229,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testCashAppPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.apmsEnabled = .on
loadPlayground(app, settings)
Expand Down Expand Up @@ -257,6 +268,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testCashAppPaymentMethod_setup() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.apmsEnabled = .on
settings.mode = .setup
Expand Down Expand Up @@ -294,6 +306,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {

func testCashAppPaymentMethod_setupFutureUsage() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.apmsEnabled = .on
settings.mode = .paymentWithSetup
Expand All @@ -318,6 +331,7 @@ class PaymentSheetStandardLPMUIOneTests: PaymentSheetStandardLPMUICase {
class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {
func testAmazonPayPaymentMethod_setup() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.apmsEnabled = .on
settings.mode = .setup
Expand All @@ -340,6 +354,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {

func testPayPalPaymentMethod_setup() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.apmsEnabled = .on
settings.merchantCountryCode = .FR
Expand All @@ -362,6 +377,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {

func testRevolutPayPaymentMethod_setup() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.apmsEnabled = .on
settings.merchantCountryCode = .GB
Expand Down Expand Up @@ -390,6 +406,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {
"FinancialConnectionsStubbedResult": "true",
]) { (_, new) in new }
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.apmsEnabled = .off
settings.allowsDelayedPMs = .on
Expand Down Expand Up @@ -436,6 +453,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {

func testGrabPayPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new // new customer
settings.apmsEnabled = .on
settings.currency = .sgd
Expand Down Expand Up @@ -471,6 +489,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {

func testUPIPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.merchantCountryCode = .IN
settings.currency = .inr
Expand Down Expand Up @@ -502,6 +521,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {
// Other confirmation flows are tested in PaymentSheet+LPMTests.swift
func testSEPADebitPaymentMethod_PaymentSheet() {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.currency = .eur
settings.allowsDelayedPMs = .on
loadPlayground(app, settings)
Expand All @@ -526,6 +546,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {

func testSavedSEPADebitPaymentMethod_FlowController_ShowsMandate() {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.merchantCountryCode = .FR
settings.uiStyle = .flowController
settings.customerMode = .new
Expand Down Expand Up @@ -587,6 +608,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {

func testAlipayPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.merchantCountryCode = .US
settings.currency = .usd
Expand All @@ -607,6 +629,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {

func testPayNowPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new // new customer
settings.apmsEnabled = .on
settings.currency = .sgd
Expand All @@ -629,6 +652,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {
class PaymentSheetStandardLPMUIThreeTests: PaymentSheetStandardLPMUICase {
func testPromptPayPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new // new customer
settings.apmsEnabled = .on
settings.currency = .thb
Expand All @@ -655,6 +679,7 @@ class PaymentSheetStandardLPMUIThreeTests: PaymentSheetStandardLPMUICase {

func testSwishPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new // new customer
settings.apmsEnabled = .off
settings.currency = .sek
Expand All @@ -674,6 +699,7 @@ class PaymentSheetStandardLPMUIThreeTests: PaymentSheetStandardLPMUICase {

func testBlikPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.apmsEnabled = .on
settings.currency = .pln
settings.merchantCountryCode = .FR
Expand All @@ -697,6 +723,7 @@ class PaymentSheetStandardLPMUIThreeTests: PaymentSheetStandardLPMUICase {

func testBacsDebit() {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.apmsEnabled = .on
settings.currency = .gbp
settings.merchantCountryCode = .GB
Expand Down Expand Up @@ -734,6 +761,7 @@ class PaymentSheetStandardLPMUIThreeTests: PaymentSheetStandardLPMUICase {
/// https://docs.stripe.com/payments/vouchers
func testMultibancoPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.currency = .eur
settings.apmsEnabled = .off
Expand Down Expand Up @@ -761,6 +789,7 @@ class PaymentSheetStandardLPMUIThreeTests: PaymentSheetStandardLPMUICase {

func testOXXOPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.merchantCountryCode = .MX
settings.currency = .mxn
Expand Down Expand Up @@ -794,6 +823,7 @@ class PaymentSheetStandardLPMUIThreeTests: PaymentSheetStandardLPMUICase {

func testBoletoPaymentMethod() throws {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.merchantCountryCode = .BR
settings.currency = .brl
Expand Down Expand Up @@ -838,6 +868,7 @@ class PaymentSheetStandardLPMUICBCTests: PaymentSheetStandardLPMUICase {
func testCardBrandChoice() throws {
// Currently only our French merchant is eligible for card brand choice
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.merchantCountryCode = .FR
settings.currency = .eur
Expand All @@ -850,6 +881,7 @@ class PaymentSheetStandardLPMUICBCTests: PaymentSheetStandardLPMUICase {
func testCardBrandChoice_setup() throws {
// Currently only our French merchant is eligible for card brand choice
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.mode = .setup
settings.customerMode = .new
settings.merchantCountryCode = .FR
Expand All @@ -863,6 +895,7 @@ class PaymentSheetStandardLPMUICBCTests: PaymentSheetStandardLPMUICase {
func testCardBrandChoice_deferred() throws {
// Currently only our French merchant is eligible for card brand choice
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.merchantCountryCode = .FR
settings.currency = .eur
Expand All @@ -876,6 +909,7 @@ class PaymentSheetStandardLPMUICBCTests: PaymentSheetStandardLPMUICase {
func testCardBrandChoiceWithPreferredNetworks() throws {
// Currently only our French merchant is eligible for card brand choice
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.merchantCountryCode = .FR
settings.currency = .eur
Expand Down Expand Up @@ -931,6 +965,7 @@ class PaymentSheetStandardLPMUICBCTests: PaymentSheetStandardLPMUICase {
func testCardBrandChoiceSavedCard() {
// Currently only our French merchant is eligible for card brand choice
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.customerMode = .new
settings.merchantCountryCode = .FR
settings.currency = .eur
Expand Down Expand Up @@ -1028,6 +1063,7 @@ class PaymentSheetStandardLPMUICBCTests: PaymentSheetStandardLPMUICase {

func testCardBrandChoiceUpdateAndRemove() {
var settings = PaymentSheetTestPlaygroundSettings.defaultValues()
settings.layout = .horizontal
settings.merchantCountryCode = .FR
settings.currency = .eur
settings.customerMode = .returning
Expand Down
Loading
Loading