Skip to content

Commit

Permalink
Get WooCommerce target's unit tests to build with the new setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Jan 3, 2025
1 parent a49a5ff commit 662b543
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import XCTest
import Networking
import Yosemite
import protocol Storage.StorageType
import WordPressAuthenticator
Expand Down Expand Up @@ -116,12 +117,12 @@ final class BlazeCampaignDashboardViewModelTests: XCTestCase {
func test_it_shows_latest_published_product_in_dashboard() async {
// Given
let checker = MockBlazeEligibilityChecker(isSiteEligible: true)
let product1: Product = .fake().copy(siteID: sampleSiteID,
let product1: Networking.Product = .fake().copy(siteID: sampleSiteID,
statusKey: (ProductStatus.published.rawValue),
purchasable: true)
insertProduct(product1)

let product2: Product = .fake().copy(siteID: sampleSiteID,
let product2: Networking.Product = .fake().copy(siteID: sampleSiteID,
statusKey: (ProductStatus.published.rawValue),
purchasable: true)

Expand Down Expand Up @@ -896,7 +897,7 @@ final class BlazeCampaignDashboardViewModelTests: XCTestCase {
}

private extension BlazeCampaignDashboardViewModelTests {
func insertProduct(_ readOnlyProduct: Product) {
func insertProduct(_ readOnlyProduct: Networking.Product) {
let newProduct = storage.insertNewObject(ofType: StorageProduct.self)
newProduct.update(with: readOnlyProduct)
storage.saveIfNeeded()
Expand All @@ -910,7 +911,7 @@ private extension BlazeCampaignDashboardViewModelTests {
storage.saveIfNeeded()
}

func mockSynchronizeProducts(insertProductToStorage product: Product? = nil) {
func mockSynchronizeProducts(insertProductToStorage product: Networking.Product? = nil) {
stores.whenReceivingAction(ofType: ProductAction.self) { [weak self] action in
switch action {
case .synchronizeProducts(_, _, _, _, _, _, _, _, _, _, _, let onCompletion):
Expand Down

0 comments on commit 662b543

Please sign in to comment.