Skip to content

Commit a7c5977

Browse files
committed
extract MockPOSSearchHistoryService
1 parent 3c28116 commit a7c5977

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,7 @@
16191619
68625DE62D4134D70042B231 /* DynamicVStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68625DE52D4134D50042B231 /* DynamicVStack.swift */; };
16201620
68674D312B6C895D00E93FBD /* ReceiptEligibilityUseCaseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68674D302B6C895D00E93FBD /* ReceiptEligibilityUseCaseTests.swift */; };
16211621
686A71B62DC9E5C10006E835 /* POSItemActionHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 686A71B52DC9E5C10006E835 /* POSItemActionHandlerTests.swift */; };
1622+
686A71B82DC9EB710006E835 /* MockPOSSearchHistoryService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 686A71B72DC9EB6D0006E835 /* MockPOSSearchHistoryService.swift */; };
16221623
68709D3D2A2ED94900A7FA6C /* UpgradesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68709D3C2A2ED94900A7FA6C /* UpgradesView.swift */; };
16231624
68709D402A2EE2DC00A7FA6C /* UpgradesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68709D3F2A2EE2DC00A7FA6C /* UpgradesViewModel.swift */; };
16241625
6879B8DB287AFFA100A0F9A8 /* CardReaderManualsViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6879B8DA287AFFA100A0F9A8 /* CardReaderManualsViewModelTests.swift */; };
@@ -4834,6 +4835,7 @@
48344835
68625DE52D4134D50042B231 /* DynamicVStack.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamicVStack.swift; sourceTree = "<group>"; };
48354836
68674D302B6C895D00E93FBD /* ReceiptEligibilityUseCaseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReceiptEligibilityUseCaseTests.swift; sourceTree = "<group>"; };
48364837
686A71B52DC9E5C10006E835 /* POSItemActionHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = POSItemActionHandlerTests.swift; sourceTree = "<group>"; };
4838+
686A71B72DC9EB6D0006E835 /* MockPOSSearchHistoryService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockPOSSearchHistoryService.swift; sourceTree = "<group>"; };
48374839
68709D3C2A2ED94900A7FA6C /* UpgradesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpgradesView.swift; sourceTree = "<group>"; };
48384840
68709D3F2A2EE2DC00A7FA6C /* UpgradesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpgradesViewModel.swift; sourceTree = "<group>"; };
48394841
6879B8DA287AFFA100A0F9A8 /* CardReaderManualsViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardReaderManualsViewModelTests.swift; sourceTree = "<group>"; };
@@ -7865,6 +7867,7 @@
78657867
02CD3BFC2C35D01600E575C4 /* Mocks */ = {
78667868
isa = PBXGroup;
78677869
children = (
7870+
686A71B72DC9EB6D0006E835 /* MockPOSSearchHistoryService.swift */,
78687871
01A3093B2DAE768000B672F6 /* MockPointOfSaleCouponService.swift */,
78697872
68503C352DA53E0800C07909 /* MockPointOfSaleCouponsController.swift */,
78707873
02CD3BFD2C35D04C00E575C4 /* MockCardPresentPaymentService.swift */,
@@ -18172,6 +18175,7 @@
1817218175
DEBAB70D2A7A6F1100743185 /* MockStorePlanSynchronizer.swift in Sources */,
1817318176
77423F17251CF77E0016A083 /* ProductDownloadListViewModelTests.swift in Sources */,
1817418177
B53A569721123D3B000776C9 /* ResultsControllerUIKitTests.swift in Sources */,
18178+
686A71B82DC9EB710006E835 /* MockPOSSearchHistoryService.swift in Sources */,
1817518179
DE126D0D26CA4A0C007F901D /* ShippingLabelCustomsFormItemDetailsViewModelTests.swift in Sources */,
1817618180
262A0999262908A60033AD20 /* OrderAddOnListI1Tests.swift in Sources */,
1817718181
0234680A282CEA5F00CFC503 /* LegacyReceiptViewModelTests.swift in Sources */,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import protocol Yosemite.POSSearchHistoryProviding
2+
import enum Yosemite.POSItemType
3+
4+
struct MockPOSSearchHistoryService: POSSearchHistoryProviding {
5+
func saveSuccessfulSearch(term: String, for itemType: POSItemType) {}
6+
7+
func searchHistory(for itemType: POSItemType) -> [String] {
8+
return []
9+
}
10+
11+
func clearSearchHistory(for itemType: POSItemType) {}
12+
13+
func clearAllSearchHistory() {}
14+
}

WooCommerce/WooCommerceTests/POS/Models/PointOfSaleAggregateModelTests.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,15 +1155,3 @@ private func makeLoadedOrderState(cartTotal: String = "",
11551155
order
11561156
)
11571157
}
1158-
1159-
private struct MockPOSSearchHistoryService: POSSearchHistoryProviding {
1160-
func saveSuccessfulSearch(term: String, for itemType: POSItemType) {}
1161-
1162-
func searchHistory(for itemType: POSItemType) -> [String] {
1163-
return []
1164-
}
1165-
1166-
func clearSearchHistory(for itemType: POSItemType) {}
1167-
1168-
func clearAllSearchHistory() {}
1169-
}

WooCommerce/WooCommerceTests/POS/Presentation/POSItemActionHandlerTests.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,3 @@ private func makeCouponItem(code: String = "") -> POSItem {
106106
private func makeProductItem() -> POSItem {
107107
return .simpleProduct(.init(id: UUID(), name: "some product name", formattedPrice: "$10.00", productID: 123, price: "10"))
108108
}
109-
110-
private struct MockPOSSearchHistoryService: POSSearchHistoryProviding {
111-
func saveSuccessfulSearch(term: String, for itemType: POSItemType) {}
112-
113-
func searchHistory(for itemType: POSItemType) -> [String] {
114-
return []
115-
}
116-
117-
func clearSearchHistory(for itemType: POSItemType) {}
118-
119-
func clearAllSearchHistory() {}
120-
}

0 commit comments

Comments
 (0)