File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
WooCommerce/WooCommerceTests Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,30 @@ final class AppCoordinatorTests: XCTestCase {
230230 XCTAssertEqual ( typePropertyValue, " site_address_error " )
231231 }
232232
233+ func test_loginLocalNotificationTapped_is_tracked_after_notification_loginWithWPCom_action( ) throws {
234+ // Given
235+ let analytics = MockAnalyticsProvider ( )
236+ let pushNotesManager = MockPushNotificationsManager ( )
237+ let appCoordinator = makeCoordinator ( window: window,
238+ stores: stores,
239+ authenticationManager: authenticationManager,
240+ analytics: WooAnalytics ( analyticsProvider: analytics) ,
241+ pushNotesManager: pushNotesManager)
242+ appCoordinator. start ( )
243+
244+ // When
245+ let response = try XCTUnwrap ( MockNotificationResponse ( actionIdentifier: LocalNotification . Action. loginWithWPCom. rawValue,
246+ requestIdentifier: LocalNotification . Scenario. loginSiteAddressError. rawValue) )
247+ pushNotesManager. sendLocalNotificationResponse ( response)
248+
249+ // Then
250+ XCTAssertEqual ( analytics. receivedEvents, [ WooAnalyticsStat . loginLocalNotificationTapped. rawValue] )
251+ let actionPropertyValue = try XCTUnwrap ( analytics. receivedProperties. first ? [ " action " ] as? String )
252+ XCTAssertEqual ( actionPropertyValue, " login_with_wpcom " )
253+ let typePropertyValue = try XCTUnwrap ( analytics. receivedProperties. first ? [ " type " ] as? String )
254+ XCTAssertEqual ( typePropertyValue, " site_address_error " )
255+ }
256+
233257 func test_loginLocalNotificationTapped_is_tracked_after_notification_tap_action( ) throws {
234258 // Given
235259 let analytics = MockAnalyticsProvider ( )
You can’t perform that action at this time.
0 commit comments