stripe-ios/StripeApplePay/StripeApplePayTests/STPAnalyticsClient+ApplePay...

31 lines
780 B
Swift

//
// STPAnalyticsClient+ApplePayTest.swift
// StripeApplePayTests
//
// Created by David Estes on 2/3/22.
// Copyright © 2022 Stripe, Inc. All rights reserved.
//
import Foundation
import XCTest
// swift-format-ignore
@_spi(STP) @testable import StripeApplePay
// swift-format-ignore
@_spi(STP) @testable import StripeCore
class STPAnalyticsClientApplePayTest: XCTestCase {
func testApplePaySDKVariantPayload() throws {
// setup
let analytic = PaymentAPIAnalytic(
event: .paymentMethodCreation,
productUsage: [],
additionalParams: [:]
)
let client = STPAnalyticsClient()
let payload = client.payload(from: analytic)
XCTAssertEqual("applepay", payload["pay_var"] as? String)
}
}