From 1567e447704980ff6b7794ee132ce7c60f840445 Mon Sep 17 00:00:00 2001 From: Ilias Pavlidakis Date: Tue, 26 Sep 2023 14:26:31 +0300 Subject: [PATCH] Add testCase that validates the association file --- SwiftUIDemoAppUITests/Tests/DeeplinkTests.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/SwiftUIDemoAppUITests/Tests/DeeplinkTests.swift b/SwiftUIDemoAppUITests/Tests/DeeplinkTests.swift index faf68ca4c..86c999cdd 100644 --- a/SwiftUIDemoAppUITests/Tests/DeeplinkTests.swift +++ b/SwiftUIDemoAppUITests/Tests/DeeplinkTests.swift @@ -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) @@ -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) }