Skip to content

Commit bbcc33e

Browse files
fix: swift tests
1 parent fe8d3cb commit bbcc33e

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

sample/android/app/src/test/java/com/shopify/checkoutkitreactnative/ShopifyCheckoutSheetKitModuleTest.java

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import static com.shopify.checkoutkitreactnative.TestFixtures.createTestCart;
44

55
import androidx.activity.ComponentActivity;
6+
import androidx.annotation.NonNull;
7+
import androidx.annotation.Nullable;
68

79
import com.facebook.react.bridge.JavaOnlyMap;
810
import com.facebook.react.bridge.ReactApplicationContext;
@@ -14,6 +16,7 @@
1416
import com.shopify.checkoutsheetkit.Preloading;
1517
import com.shopify.checkoutsheetkit.ColorScheme;
1618
import com.shopify.checkoutsheetkit.Authentication;
19+
import com.shopify.checkoutsheetkit.lifecycleevents.CartPaymentInstrument;
1720
import com.shopify.checkoutsheetkit.lifecycleevents.CheckoutCompleteEvent;
1821
import com.shopify.checkoutsheetkit.lifecycleevents.CheckoutStartEvent;
1922
import com.shopify.checkoutsheetkit.lifecycleevents.Cart;
@@ -44,6 +47,11 @@
4447
import android.content.Context;
4548

4649
import java.util.ArrayList;
50+
import java.util.Collection;
51+
import java.util.Collections;
52+
import java.util.Iterator;
53+
import java.util.List;
54+
import java.util.ListIterator;
4755

4856
@RunWith(MockitoJUnitRunner.class)
4957
public class ShopifyCheckoutSheetKitModuleTest {
@@ -543,18 +551,19 @@ public void testCompleteConfigurationAndEventFlow() {
543551

544552
private Cart buildMinimalCart(String cartId, String amount, String currencyCode) {
545553
return new Cart(
546-
cartId,
547-
new ArrayList<>(), // lines
548-
new CartCost(
549-
new Money(amount, currencyCode),
550-
new Money(amount, currencyCode)
551-
),
552-
new CartBuyerIdentity(null, null, null, null),
553-
new ArrayList<>(), // deliveryGroups
554-
new ArrayList<>(), // discountCodes
555-
new ArrayList<>(), // appliedGiftCards
556-
new ArrayList<>(), // discountAllocations
557-
new CartDelivery(new ArrayList<>())
554+
cartId,
555+
new ArrayList<>(), // lines
556+
new CartCost(
557+
new Money(amount, currencyCode),
558+
new Money(amount, currencyCode)
559+
),
560+
new CartBuyerIdentity(null, null, null, null),
561+
new ArrayList<>(), // deliveryGroups
562+
new ArrayList<>(), // discountCodes
563+
new ArrayList<>(), // appliedGiftCards
564+
new ArrayList<>(), // discountAllocations
565+
new CartDelivery(new ArrayList<>()),
566+
new ArrayList<>() { } // paymentInstruments
558567
);
559568
}
560569

sample/ios/ReactNativeTests/RCTCheckoutWebViewTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ class RCTCheckoutWebViewTests: XCTestCase {
313313
discountCodes: [],
314314
appliedGiftCards: [],
315315
discountAllocations: [],
316-
delivery: CartDelivery(addresses: [])
316+
delivery: CartDelivery(addresses: []),
317+
payment: .init(instruments: [])
317318
)
318319
let event = CheckoutStartEvent(cart: cart)
319320

@@ -347,7 +348,8 @@ private func createTestCart(
347348
discountCodes: [],
348349
appliedGiftCards: [],
349350
discountAllocations: [],
350-
delivery: .init(addresses: [])
351+
delivery: .init(addresses: []),
352+
payment: .init(instruments: [])
351353
)
352354
}
353355

0 commit comments

Comments
 (0)