@@ -57,7 +57,7 @@ class AcceleratedCheckouts_SupportedTests: XCTestCase {
57
57
ShopifyCheckoutSheetKit . configuration. closeButtonTintColor = nil
58
58
}
59
59
60
- private func configureAcceleratedCheckouts( includeApplePay: Bool ) {
60
+ private func configureAcceleratedCheckouts( includeApplePay: Bool , customerAccessToken : String ? = nil ) {
61
61
let expectation = self . expectation ( description: " configureAcceleratedCheckouts " )
62
62
63
63
let storefrontDomain = " example.myshopify.com "
@@ -72,6 +72,7 @@ class AcceleratedCheckouts_SupportedTests: XCTestCase {
72
72
storefrontAccessToken: accessToken,
73
73
customerEmail: email,
74
74
customerPhoneNumber: phone,
75
+ customerAccessToken: customerAccessToken,
75
76
applePayMerchantIdentifier: merchantIdentifier,
76
77
applyPayContactFields: contactFields,
77
78
resolve: { _ in expectation. fulfill ( ) } ,
@@ -144,6 +145,23 @@ class AcceleratedCheckouts_SupportedTests: XCTestCase {
144
145
XCTAssertEqual ( afterValue, true )
145
146
}
146
147
148
+ func testConfigureAcceleratedCheckoutsStoresCustomerAccessToken( ) throws {
149
+ let token = " customer-access-token-123 "
150
+ configureAcceleratedCheckouts ( includeApplePay: false , customerAccessToken: token)
151
+ guard let config = AcceleratedCheckoutConfiguration . shared. configuration else {
152
+ return XCTFail ( " configuration missing " )
153
+ }
154
+ XCTAssertEqual ( config. customer? . copy ( ) . customerAccessToken, token)
155
+ }
156
+
157
+ func testConfigureAcceleratedCheckoutsWithNilCustomerAccessToken( ) throws {
158
+ configureAcceleratedCheckouts ( includeApplePay: false , customerAccessToken: nil )
159
+ guard let config = AcceleratedCheckoutConfiguration . shared. configuration else {
160
+ return XCTFail ( " configuration missing " )
161
+ }
162
+ XCTAssertNil ( config. customer? . copy ( ) . customerAccessToken)
163
+ }
164
+
147
165
func testButtonsViewHeightZeroWhenWalletsExplicitEmpty( ) throws {
148
166
configureAcceleratedCheckouts ( includeApplePay: false )
149
167
0 commit comments