Skip to content

Commit

Permalink
Improve TealiumInstanceManager tests reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
Enricoza committed Mar 19, 2024
1 parent 7a7d4ea commit 7ab968b
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,13 @@ class TealiumInstanceManagerTests: XCTestCase {
func testDidOpenUrlToDataLayer() {
let config = testTealiumConfig.copy
let tealium = Tealium(config: config, dataLayer: MockInMemoryDataLayer(), modulesManager: nil, migrator: nil, enableCompletion: nil)

let expectationRequest = expectation(description: "emptyEventDetected")
let url = URL(string: "https://www.google.it")!
TealiumInstanceManager.shared.didOpenUrl(url)

TealiumQueues.backgroundSerialQueue.async {
TealiumQueues.backgroundSerialQueue.sync {
let dataLayerUrl = tealium.dataLayer.all[TealiumDataKey.deepLinkURL] as? String
expectationRequest.fulfill()
XCTAssertEqual(url.absoluteString, dataLayerUrl)
}
waitForExpectations(timeout: 8.0, handler: nil)
}

}

0 comments on commit 7ab968b

Please sign in to comment.