Skip to content

Commit ae05dab

Browse files
authored
Skip tests in code rather than in test plan for Networking (#15725)
2 parents 0b1330f + 6fc5a40 commit ae05dab

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

Networking/NetworkingTests/Mapper/InAppPurchaseOrderResultMapperTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import XCTest
33

44
final class InAppPurchasesOrderResultMapperTests: XCTestCase {
55
func test_iap_order_creation_is_decoded_from_json_response() throws {
6+
try XCTSkipIf(true)
7+
68
// Given
79
let jsonData = try XCTUnwrap(Loader.contentsOf("iap-order-create"))
810
let expectedOrderId = 12345

Networking/NetworkingTests/Mapper/InAppPurchasesProductsMapperTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import XCTest
33

44
final class InAppPurchasesProductsMapperTests: XCTestCase {
55
func test_iap_products_list_is_decoded_from_json_response() throws {
6+
try XCTSkipIf(true)
7+
68
// Given
79
let jsonData = try XCTUnwrap(Loader.contentsOf("iap-products"))
810
let expectedProductIdentifiers = [

Networking/NetworkingTests/Mapper/InAppPurchasesTransactionMapperTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import XCTest
33

44
final class InAppPurchasesTransactionMapperTests: XCTestCase {
55
func test_iap_handled_transaction_is_decoded_from_json_response() throws {
6+
try XCTSkipIf(true)
7+
68
// Given
79
let jsonData = try XCTUnwrap(Loader.contentsOf("iap-transaction-handled"))
810
let expectedSiteID = Int64(1234)
@@ -15,6 +17,8 @@ final class InAppPurchasesTransactionMapperTests: XCTestCase {
1517
}
1618

1719
func test_iap_unhandled_transaction_is_decoded_from_json_response() throws {
20+
try XCTSkipIf(true)
21+
1822
// Given
1923
let jsonData = try XCTUnwrap(Loader.contentsOf("iap-transaction-not-handled"))
2024
let expectedErrorMessage = "Transaction not found."

Networking/NetworkingTests/Remote/InAppPurchasesRemoteTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class InAppPurchasesRemoteTests: XCTestCase {
2828
/// Verifies that 'moderateComment' as spam properly parses the successful response
2929
///
3030
func test_load_products_returns_list_of_products() throws {
31+
try XCTSkipIf(true)
32+
3133
// Given
3234
let remote = InAppPurchasesRemote(network: network)
3335

@@ -48,6 +50,8 @@ class InAppPurchasesRemoteTests: XCTestCase {
4850
}
4951

5052
func test_purchase_product_returns_created_order() throws {
53+
try XCTSkipIf(true)
54+
5155
// Given
5256
let remote = InAppPurchasesRemote(network: network)
5357

@@ -75,6 +79,8 @@ class InAppPurchasesRemoteTests: XCTestCase {
7579
}
7680

7781
func test_retrieveHandledTransactionSiteID_when_success_to_retrieve_response_and_transaction_is_handled_then_returns_siteID() throws {
82+
try XCTSkipIf(true)
83+
7884
// Given
7985
let remote = InAppPurchasesRemote(network: network)
8086
let transactionID: UInt64 = 1234
@@ -118,6 +124,8 @@ class InAppPurchasesRemoteTests: XCTestCase {
118124
}
119125

120126
func test_retrieveHandledTransactionSiteID_when_fails_to_retrieve_response_then_returns_network_error() throws {
127+
try XCTSkipIf(true)
128+
121129
// Given
122130
let remote = InAppPurchasesRemote(network: network)
123131
let transactionID: UInt64 = 1234

Networking/NetworkingTests/Remote/WCPayRemoteTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ final class WCPayRemoteTests: XCTestCase {
111111

112112
XCTAssertTrue(result.isSuccess)
113113
let account = try result.get()
114+
115+
XCTExpectFailure("isCardPresentEligible has been hardcoded to true. See https://github.com/woocommerce/woocommerce-ios/pull/5030")
114116
XCTAssertEqual(account.isCardPresentEligible, false)
115117
}
116118

@@ -130,6 +132,8 @@ final class WCPayRemoteTests: XCTestCase {
130132

131133
XCTAssertTrue(result.isSuccess)
132134
let account = try result.get()
135+
136+
XCTExpectFailure("isCardPresentEligible has been hardcoded to true. See https://github.com/woocommerce/woocommerce-ios/pull/5030")
133137
XCTAssertEqual(account.isCardPresentEligible, false)
134138
}
135139

WooCommerce/WooCommerceTests/UnitTests.xctestplan

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,6 @@
8888
}
8989
},
9090
{
91-
"skippedTests" : [
92-
"InAppPurchasesOrderResultMapperTests",
93-
"InAppPurchasesOrderResultMapperTests\/test_iap_order_creation_is_decoded_from_json_response()",
94-
"InAppPurchasesProductsMapperTests",
95-
"InAppPurchasesRemoteTests",
96-
"InAppPurchasesRemoteTests\/test_load_products_returns_list_of_products()",
97-
"InAppPurchasesRemoteTests\/test_purchase_product_returns_created_order()",
98-
"InAppPurchasesRemoteTests\/test_retrieveHandledTransactionSiteID_when_fails_to_retrieve_response_then_returns_network_error()",
99-
"InAppPurchasesRemoteTests\/test_retrieveHandledTransactionSiteID_when_success_to_retrieve_response_and_transaction_is_handled_then_returns_siteID()",
100-
"InAppPurchasesRemoteTests\/test_retrieveHandledTransactionSiteID_when_success_to_retrieve_response_and_transaction_is_not_handled_then_returns_errorResponse()",
101-
"InAppPurchasesTransactionMapperTests",
102-
"InAppPurchasesTransactionMapperTests\/test_iap_handled_transaction_is_decoded_from_json_response()",
103-
"InAppPurchasesTransactionMapperTests\/test_iap_unhandled_transaction_is_decoded_from_json_response()",
104-
"WCPayRemoteTests\/test_loadAccount_properly_handles_implicitly_not_eligible_for_card_present_payments()",
105-
"WCPayRemoteTests\/test_loadAccount_properly_handles_not_eligible_for_card_present_payments()"
106-
],
10791
"target" : {
10892
"containerPath" : "container:..\/Networking\/Networking.xcodeproj",
10993
"identifier" : "B557D9EB209753AA005962F4",

0 commit comments

Comments
 (0)