Skip to content

Commit 92e7282

Browse files
committed
Fix tests for products onboarding eligibility check
1 parent 5a58eb6 commit 92e7282

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Yosemite/YosemiteTests/Stores/ProductStoreTests.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,11 +1528,11 @@ final class ProductStoreTests: XCTestCase {
15281528
XCTAssertTrue(finished)
15291529
}
15301530

1531-
// MARK: - ProductAction.checkForProducts
1531+
// MARK: - ProductAction.checkProductsOnboardingEligibility
15321532

1533-
/// Verifies that ProductAction.checkForProducts returns true result when remote returns an array with a product ID.
1533+
/// Verifies that ProductAction.checkProductsOnboardingEligibility returns false result when remote returns an array with a product ID.
15341534
///
1535-
func test_checkForProducts_returns_expected_result_when_remote_returns_product() throws {
1535+
func test_checkProductsOnboardingEligibility_returns_expected_result_when_remote_returns_product() throws {
15361536
// Given
15371537
let productStore = ProductStore(dispatcher: dispatcher, storageManager: storageManager, network: network)
15381538
network.simulateResponse(requestUrlSuffix: "products", filename: "products-ids-only")
@@ -1547,13 +1547,13 @@ final class ProductStoreTests: XCTestCase {
15471547

15481548
// Then
15491549
XCTAssertTrue(result.isSuccess)
1550-
let hasProducts = try XCTUnwrap(result.get())
1551-
XCTAssertTrue(hasProducts)
1550+
let isEligible = try XCTUnwrap(result.get())
1551+
XCTAssertFalse(isEligible)
15521552
}
15531553

1554-
/// Verifies that ProductAction.checkForProducts returns true result when a product already exists in local storage.
1554+
/// Verifies that ProductAction.checkProductsOnboardingEligibility returns false result when a product already exists in local storage.
15551555
///
1556-
func test_checkForProducts_with_IDs_returns_expected_result_when_local_storage_has_product() throws {
1556+
func test_checkProductsOnboardingEligibility_with_IDs_returns_expected_result_when_local_storage_has_product() throws {
15571557
// Given
15581558
storageManager.insertSampleProduct(readOnlyProduct: Product.fake().copy(siteID: sampleSiteID))
15591559
let productStore = ProductStore(dispatcher: dispatcher, storageManager: storageManager, network: network)
@@ -1568,13 +1568,13 @@ final class ProductStoreTests: XCTestCase {
15681568

15691569
// Then
15701570
XCTAssertTrue(result.isSuccess)
1571-
let hasProducts = try XCTUnwrap(result.get())
1572-
XCTAssertTrue(hasProducts)
1571+
let isEligible = try XCTUnwrap(result.get())
1572+
XCTAssertFalse(isEligible)
15731573
}
15741574

1575-
/// Verifies that ProductAction.checkForProducts returns false result for an empty array.
1575+
/// Verifies that ProductAction.checkProductsOnboardingEligibility returns true result for an empty array.
15761576
///
1577-
func test_checkForProducts_returns_expected_result_when_remote_returns_empty_array() throws {
1577+
func test_checkProductsOnboardingEligibility_returns_expected_result_when_remote_returns_empty_array() throws {
15781578
// Given
15791579
let productStore = ProductStore(dispatcher: dispatcher, storageManager: storageManager, network: network)
15801580
network.simulateResponse(requestUrlSuffix: "products", filename: "products-ids-only-empty")
@@ -1589,8 +1589,8 @@ final class ProductStoreTests: XCTestCase {
15891589

15901590
// Then
15911591
XCTAssertTrue(result.isSuccess)
1592-
let hasProducts = try XCTUnwrap(result.get())
1593-
XCTAssertFalse(hasProducts)
1592+
let isEligible = try XCTUnwrap(result.get())
1593+
XCTAssertTrue(isEligible)
15941594
}
15951595
}
15961596

0 commit comments

Comments
 (0)