File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
WooCommerce/WooCommerceTests/POS/Models Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -900,7 +900,20 @@ struct PointOfSaleAggregateModelTests {
900900 await sut. startCashPayment ( )
901901
902902 // Then
903- #expect( analytics. events. first ( where: { $0. eventName == " cash_payment_tapped " } ) != nil )
903+ #expect( analytics. events. first ( where: { $0. eventName == " checkout_cash_payment_tapped " } ) != nil )
904+ }
905+
906+ @Test func collectCashPayment_when_invoked_tracks_expected_event( ) async throws {
907+ // Given
908+ let analyticsTracker = MockPOSCollectOrderPaymentAnalyticsTracker ( )
909+ let sut = makePointOfSaleAggregateModel ( orderController: orderController,
910+ collectOrderPaymentAnalyticsTracker: analyticsTracker)
911+
912+ // When
913+ try await sut. collectCashPayment ( changeDueAmount: " 0.00 " )
914+
915+ // Then
916+ #expect( analyticsTracker. didCallTrackSuccessfulCashPayment == true )
904917 }
905918 }
906919
You can’t perform that action at this time.
0 commit comments