diff options
Diffstat (limited to 'HutchTests/DeepLinkTests.swift')
| -rw-r--r-- | HutchTests/DeepLinkTests.swift | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/HutchTests/DeepLinkTests.swift b/HutchTests/DeepLinkTests.swift index c57cfce..500c4cd 100644 --- a/HutchTests/DeepLinkTests.swift +++ b/HutchTests/DeepLinkTests.swift @@ -19,7 +19,19 @@ struct DeepLinkTests { @Test func parsesRepositoryLink() { let link = DeepLink(url: HutchDeepLinkURL.repositoryGit) - #expect(link == .repository(owner: "~user", repo: "repo")) + #expect(link == .repository(service: .git, owner: "~user", repo: "repo")) + } + + @Test + func parsesHgRepositoryLink() { + let link = DeepLink(url: HutchDeepLinkURL.repositoryHg) + #expect(link == .repository(service: .hg, owner: "~user", repo: "repo")) + } + + @Test + func parsesServiceOwnerRootAsUserProfile() { + let link = DeepLink(url: HutchDeepLinkURL.gitOwnerRoot) + #expect(link == .userProfile(owner: "~owner")) } @Test @@ -35,6 +47,18 @@ struct DeepLinkTests { } @Test + func parsesBuildJobLinkWithOwnerPath() { + let link = DeepLink(url: HutchDeepLinkURL.buildJobWithOwner) + #expect(link == .build(jobId: 12345)) + } + + @Test + func parsesMailingListLink() { + let link = DeepLink(url: HutchDeepLinkURL.mailingList) + #expect(link == .mailingList(owner: "~owner", list: "list")) + } + + @Test func parsesBuildsTabLink() { let link = DeepLink(url: HutchDeepLinkURL.builds) #expect(link == .buildsTab) @@ -65,6 +89,12 @@ struct DeepLinkTests { } @Test + func parsesUserProfileLink() { + let link = DeepLink(url: HutchDeepLinkURL.userProfile) + #expect(link == .userProfile(owner: "~owner")) + } + + @Test func rejectsNonHutchScheme() { let link = DeepLink(url: URL(string: "https://example.com/home")!) #expect(link == nil) |
