File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
WooCommerce/WooCommerceTests Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,25 @@ final class AppCoordinatorTests: XCTestCase {
318318 appCoordinator. start ( )
319319
320320 // Then
321- XCTAssertEqual ( analytics. receivedEvents, [ WooAnalyticsStat . loginOnboardingShown. rawValue] )
321+ _ = try XCTUnwrap ( analytics. receivedEvents. firstIndex ( where: { $0 == WooAnalyticsStat . loginOnboardingShown. rawValue} ) )
322+ }
323+
324+ func test_trackRestAPILoginExperimentVariation_is_tracked_after_presenting_onboarding( ) throws {
325+ // Given
326+ stores. deauthenticate ( )
327+ let analytics = MockAnalyticsProvider ( )
328+ let appCoordinator = makeCoordinator ( window: window,
329+ stores: stores,
330+ authenticationManager: authenticationManager,
331+ analytics: WooAnalytics ( analyticsProvider: analytics) )
332+
333+ // When
334+ appCoordinator. start ( )
335+
336+ // Then
337+ let indexOfEvent = try XCTUnwrap ( analytics. receivedEvents. firstIndex ( where: { $0 == " rest_api_login_experiment " } ) )
338+ let eventProperties = try XCTUnwrap ( analytics. receivedProperties [ indexOfEvent] )
339+ XCTAssertNotNil ( eventProperties [ " experiment_variant " ] as? String )
322340 }
323341
324342 // MARK: - Login reminder analytics
You can’t perform that action at this time.
0 commit comments