Skip to content

Commit

Permalink
Add testCase that validates the association file
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis committed Sep 26, 2023
1 parent dd34c06 commit 1567e44
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions SwiftUIDemoAppUITests/Tests/DeeplinkTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ final class DeeplinkTests: StreamTestCase {
static let customScheme: URL = .init(string: "streamvideo://video/demos?id=test-call")!
}

func test_associationFile_validationWasSuccessful() throws {
let contentData = try Data(contentsOf: .init(string: "https://getstream.io/.well-known/apple-app-site-association")!)
let content = try XCTUnwrap(String(data: contentData, encoding: .utf8))
.trimmingCharacters(in: .whitespacesAndNewlines)
.replacingOccurrences(of: "\n", with: "")
.replacingOccurrences(of: " ", with: "")

XCTAssertEqual(content, """
{"applinks":{"apps":[],"details":[{"appID":"EHV7XZLAHA.io.getstream.iOS.VideoDemoApp","paths":["/video/demos/*","/video/demos"]}]}}
""")
}

func test_universalLink_production_joinsExpectedCall() {
WHEN("") {
Safari.openUniversalLinkFromSmartBanner(MockDeeplink.production)
Expand All @@ -40,9 +52,6 @@ final class DeeplinkTests: StreamTestCase {
}

func test_customSchemeURL_joinsExpectedCall() {
GIVEN("") {
app.terminate()
}
WHEN("User opens a URL that contains a custom scheme") {
Safari.openApp(MockDeeplink.customScheme)
}
Expand Down

0 comments on commit 1567e44

Please sign in to comment.