@@ -433,6 +433,10 @@ class RUMViewScopeTests: XCTestCase {
433
433
customTimings: [ : ] ,
434
434
startTime: Date ( )
435
435
)
436
+
437
+ let logOutput = LogOutputMock ( )
438
+ userLogger = . mockWith( logOutput: logOutput)
439
+
436
440
XCTAssertTrue (
437
441
scope. process ( command: RUMStartViewCommand . mockWith ( identity: mockView) )
438
442
)
@@ -445,10 +449,17 @@ class RUMViewScopeTests: XCTestCase {
445
449
XCTAssertNotNil ( scope. userActionScope)
446
450
XCTAssertEqual ( scope. userActionScope? . name, actionName)
447
451
452
+ let secondAction = RUMStartUserActionCommand . mockWith ( actionType: . swipe, name: . mockRandom( ) )
448
453
XCTAssertTrue (
449
- scope. process ( command: RUMStartUserActionCommand . mockWith ( actionType : . swipe , name : . mockRandom ( ) ) )
454
+ scope. process ( command: secondAction )
450
455
)
451
456
XCTAssertEqual ( scope. userActionScope? . name, actionName, " View should ignore the next (only non-custom) UA if one is pending. " )
457
+ XCTAssertEqual (
458
+ logOutput. recordedLog? . message,
459
+ """
460
+ RUM Action ' \( secondAction. actionType) ' on ' \( secondAction. name) ' was dropped, because another action is still active for the same view.
461
+ """
462
+ )
452
463
453
464
XCTAssertTrue (
454
465
scope. process ( command: RUMAddUserActionCommand . mockWith ( actionType: . custom, name: . mockRandom( ) ) )
@@ -479,6 +490,10 @@ class RUMViewScopeTests: XCTestCase {
479
490
customTimings: [ : ] ,
480
491
startTime: currentTime
481
492
)
493
+
494
+ let logOutput = LogOutputMock ( )
495
+ userLogger = . mockWith( logOutput: logOutput)
496
+
482
497
XCTAssertTrue (
483
498
scope. process ( command: RUMStartViewCommand . mockWith ( time: currentTime, identity: mockView) )
484
499
)
@@ -493,10 +508,17 @@ class RUMViewScopeTests: XCTestCase {
493
508
XCTAssertNotNil ( scope. userActionScope)
494
509
XCTAssertEqual ( scope. userActionScope? . name, actionName)
495
510
511
+ let secondAction = RUMAddUserActionCommand . mockWith ( time: currentTime, actionType: . tap, name: . mockRandom( ) )
496
512
XCTAssertTrue (
497
- scope. process ( command: RUMAddUserActionCommand . mockWith ( time : currentTime , actionType : . tap , name : . mockRandom ( ) ) )
513
+ scope. process ( command: secondAction )
498
514
)
499
515
XCTAssertEqual ( scope. userActionScope? . name, actionName, " View should ignore the next (only non-custom) UA if one is pending. " )
516
+ XCTAssertEqual (
517
+ logOutput. recordedLog? . message,
518
+ """
519
+ RUM Action ' \( secondAction. actionType) ' on ' \( secondAction. name) ' was dropped, because another action is still active for the same view.
520
+ """
521
+ )
500
522
501
523
XCTAssertTrue (
502
524
scope. process ( command: RUMAddUserActionCommand . mockWith ( actionType: . custom, name: . mockRandom( ) ) )
0 commit comments