Skip to content

Commit f86a79d

Browse files
committed
Add new test for WCPayChargeMapper
1 parent 833e0c6 commit f86a79d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Networking/NetworkingTests/Mapper/WCPayChargeMapperTests.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ class WCPayChargeMapperTests: XCTestCase {
88

99
/// Verifies that the WCPayCharge is parsed.
1010
///
11-
func test_WCPayCharge_map_parses_all_coupons_in_response() throws {
11+
func test_WCPayCharge_map_parses_data_in_response() throws {
1212
let wcpayCharge = try mapRetrieveWCPayChargeResponse()
1313
XCTAssertNotNil(wcpayCharge)
1414
}
1515

16+
/// Verifies that the WCPayCharge is parsed.
17+
///
18+
func test_WCPayCharge_map_parses_data_in_response_without_data_envelope() throws {
19+
let wcpayCharge = try mapRetrieveWCPayChargeResponse(responseName: .cardPresentWithoutDataEnvelope)
20+
XCTAssertNotNil(wcpayCharge)
21+
}
22+
1623
/// Verifies that the `siteID` is added in the mapper, because it's not provided by the API endpoint
1724
///
1825
func test_WCPayCharge_map_includes_siteID_in_parsed_results() throws {
@@ -173,6 +180,7 @@ private extension WCPayChargeMapperTests {
173180

174181
enum ChargeResponse: String {
175182
case cardPresent = "wcpay-charge-card-present"
183+
case cardPresentWithoutDataEnvelope = "wcpay-charge-card-present-without-data"
176184
case cardPresentMinimal = "wcpay-charge-card-present-minimal"
177185
case card = "wcpay-charge-card"
178186
case interacPresent = "wcpay-charge-interac-present"

0 commit comments

Comments
 (0)