@@ -30,7 +30,7 @@ class MixpanelAutomaticEventsTests: MixpanelBaseTests {
30
30
XCTAssertNotNil ( event, " Should have an event " )
31
31
XCTAssertEqual ( event ? [ " event " ] as? String , " $ae_session " , " should be app session event " )
32
32
XCTAssertNotNil ( ( event ? [ " properties " ] as? [ String : Any ] ) ? [ " $ae_session_length " ] , " should have session length " )
33
- removeDBFileForInstance ( testMixpanel)
33
+ removeDBfile ( testMixpanel. apiToken )
34
34
}
35
35
36
36
func testKeepAutomaticEventsIfNetworkNotAvailable( ) {
@@ -43,7 +43,7 @@ class MixpanelAutomaticEventsTests: MixpanelBaseTests {
43
43
let event = eventQueue ( token: testMixpanel. apiToken) . last
44
44
XCTAssertTrue ( eventQueue ( token: testMixpanel. apiToken) . count == 2 , " automatic events should be accumulated if device is offline " )
45
45
XCTAssertEqual ( event ? [ " event " ] as? String , " $ae_session " , " should be app session event " )
46
- removeDBFileForInstance ( testMixpanel)
46
+ removeDBfile ( testMixpanel. apiToken )
47
47
}
48
48
49
49
func testDiscardAutomaticEventsIftrackAutomaticEventsEnabledIsFalse( ) {
@@ -53,7 +53,7 @@ class MixpanelAutomaticEventsTests: MixpanelBaseTests {
53
53
with: Notification ( name: Notification . Name ( rawValue: " test " ) ) )
54
54
waitForTrackingQueue ( testMixpanel)
55
55
XCTAssertTrue ( eventQueue ( token: testMixpanel. apiToken) . count == 0 , " automatic events should not be tracked " )
56
- removeDBFileForInstance ( testMixpanel)
56
+ removeDBfile ( testMixpanel. apiToken )
57
57
}
58
58
59
59
func testFlushAutomaticEventsIftrackAutomaticEventsEnabledIsTrue( ) {
@@ -66,7 +66,7 @@ class MixpanelAutomaticEventsTests: MixpanelBaseTests {
66
66
67
67
flushAndWaitForTrackingQueue ( testMixpanel)
68
68
XCTAssertTrue ( eventQueue ( token: testMixpanel. apiToken) . count == 0 , " automatic events should be flushed " )
69
- removeDBFileForInstance ( testMixpanel)
69
+ removeDBfile ( testMixpanel. apiToken )
70
70
}
71
71
72
72
func testUpdated( ) {
@@ -89,7 +89,6 @@ class MixpanelAutomaticEventsTests: MixpanelBaseTests {
89
89
mp2. minimumSessionDuration = 0 ;
90
90
waitForTrackingQueue ( mp2)
91
91
XCTAssertEqual ( eventQueue ( token: mp2. apiToken) . count, 0 , " First app open should not be tracked again " )
92
- removeDBFileForInstance ( mp)
93
92
}
94
93
95
94
func testAutomaticEventsInMultipleInstances( ) {
@@ -125,7 +124,7 @@ class MixpanelAutomaticEventsTests: MixpanelBaseTests {
125
124
let otherAppSessionEvent = eventQueue ( token: mp2. apiToken) . last
126
125
XCTAssertEqual ( otherAppSessionEvent ? [ " event " ] as? String , " $ae_session " , " should be app session event " )
127
126
XCTAssertNotNil ( ( otherAppSessionEvent ? [ " properties " ] as? [ String : Any ] ) ? [ " $ae_session_length " ] , " should have session length " )
128
- removeDBFileForInstance ( mp)
129
- removeDBFileForInstance ( mp2)
127
+ removeDBfile ( mp. apiToken )
128
+ removeDBfile ( mp2. apiToken )
130
129
}
131
130
}
0 commit comments