File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -162,12 +162,12 @@ class InboxTests: XCTestCase {
162
162
let mockInAppFetcher = MockInAppFetcher ( )
163
163
let config = IterableConfig ( )
164
164
config. logDelegate = AllLogDelegate ( )
165
-
165
+
166
166
let internalAPI = InternalIterableAPI . initializeForTesting (
167
167
config: config,
168
168
inAppFetcher: mockInAppFetcher
169
169
)
170
-
170
+
171
171
let payload = """
172
172
{ " inAppMessages " :
173
173
[
@@ -190,19 +190,21 @@ class InboxTests: XCTestCase {
190
190
]
191
191
}
192
192
""" . toJsonDict ( )
193
-
193
+
194
194
mockInAppFetcher. mockInAppPayloadFromServer ( internalApi: internalAPI, payload) . onSuccess { _ in
195
195
let messages = internalAPI. inAppManager. getInboxMessages ( )
196
196
XCTAssertEqual ( messages. count, 2 )
197
-
198
- internalAPI. inAppManager. remove ( message: messages [ 0 ] , location: . inbox, source: . inboxSwipe)
199
- DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.05 ) {
197
+
198
+ let messageToRemove = messages [ 0 ]
199
+ internalAPI. inAppManager. remove ( messageToRemove, location: . inbox, source: . inboxSwipe) { success in
200
+ XCTAssertTrue ( success)
200
201
let newMessages = internalAPI. inAppManager. getInboxMessages ( )
201
202
XCTAssertEqual ( newMessages. count, 1 )
203
+ XCTAssertFalse ( newMessages. contains ( messageToRemove) )
202
204
expectation1. fulfill ( )
203
205
}
204
206
}
205
-
207
+
206
208
wait ( for: [ expectation1] , timeout: testExpectationTimeout)
207
209
}
208
210
You can’t perform that action at this time.
0 commit comments