Skip to content

Commit beaa785

Browse files
committed
Add a simple test to test using multiple site ids
1 parent 9b9db54 commit beaa785

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/ParselyTrackerTests.swift

+8
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ class ParselyTrackerTests: ParselyTestCase {
7474
// A call to Parsely.resetVideo should remove a tracked video from the video manager
7575
expectParselyState(self.parselyTestTracker.track.videoManager.trackedVideos.isEmpty).toEventually(beTrue())
7676
}
77+
func testMultipleSites() {
78+
parselyTestTracker.trackPageView(url: testUrl)
79+
parselyTestTracker.trackPageView(url: testUrl, siteId: "another-site.com")
80+
expectParselyState(self.parselyTestTracker.eventQueue.length()).toEventually(equal(2))
81+
82+
let eventSiteIds = self.parselyTestTracker.eventQueue.get().map { $0.idsite }
83+
XCTAssertEqual(eventSiteIds, [Parsely.testAPIKey, "another-site.com"])
84+
}
7785

7886
// A helper method to safely inspect the tracker's internal state.
7987
private func expectParselyState<T>(file: FileString = #file, line: UInt = #line, _ expression: @autoclosure @escaping () -> T?) -> SyncExpectation<T> {

0 commit comments

Comments
 (0)