Skip to content

Commit 53b24f5

Browse files
committed
adds completion callback to track method
1 parent b261d7e commit 53b24f5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Tests/FormbricksSDKTests/FormbricksSDKTests.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,12 @@ final class FormbricksSDKTests: XCTestCase {
151151
Formbricks.logout()
152152
Formbricks.surveyManager?.filterSurveys()
153153

154-
Formbricks.track("click_demo_button")
155154
let thirdTrackExpectation = expectation(description: "Third track event")
156-
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
155+
Formbricks.track("click_demo_button", completion: {
157156
thirdTrackExpectation.fulfill()
158-
}
159-
wait(for: [thirdTrackExpectation], timeout: 1.0)
157+
})
160158

159+
wait(for: [thirdTrackExpectation], timeout: 2.0)
161160
XCTAssertTrue(Formbricks.surveyManager?.isShowingSurvey ?? false)
162161

163162
// Test the cleanup

0 commit comments

Comments
 (0)