File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
WooCommerce/WooCommerceTests/POS/Models Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,24 @@ struct PointOfSaleAggregateModelTests {
166
166
#expect( sut. cart. isEmpty)
167
167
}
168
168
169
+ @available ( iOS 17 . 0 , * )
170
+ @Test func removeAllItemsFromCart_when_tapped_then_tracks_event( ) {
171
+ // Given
172
+ let sut = PointOfSaleAggregateModel (
173
+ itemsController: MockPointOfSaleItemsController ( ) ,
174
+ cardPresentPaymentService: MockCardPresentPaymentService ( ) ,
175
+ orderController: MockPointOfSaleOrderController ( ) ,
176
+ analytics: analytics,
177
+ collectOrderPaymentAnalyticsTracker: MockPOSCollectOrderPaymentAnalyticsTracker ( )
178
+ )
179
+
180
+ //When
181
+ sut. removeAllItemsFromCart ( )
182
+
183
+ // Then
184
+ #expect( analyticsProvider. receivedEvents. first ( where: { $0 == " clear_cart_tapped " } ) != nil )
185
+ }
186
+
169
187
@available ( iOS 17 . 0 , * )
170
188
@Test ( . disabled(
171
189
"""
You can’t perform that action at this time.
0 commit comments