diff options
| author | Christian Cleberg <[email protected]> | 2026-04-12 00:34:54 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-12 00:34:54 -0500 |
| commit | 5f6d545eb3455a9e4da5a3cb4460811e3a48d939 (patch) | |
| tree | 7b7591146da4e02bd617ddb9f26e47b1c4474ef6 /HutchTests/AppStateTests.swift | |
| parent | cb1ea5ea4f163d87053285d3fb7999b12a3558b9 (diff) | |
| download | hutch-2.14.0.tar.gz hutch-2.14.0.tar.bz2 hutch-2.14.0.zip | |
improve home attention flows and cross-linkingv2.14.0
Diffstat (limited to 'HutchTests/AppStateTests.swift')
| -rw-r--r-- | HutchTests/AppStateTests.swift | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/HutchTests/AppStateTests.swift b/HutchTests/AppStateTests.swift index 9cf4e13..fe357cb 100644 --- a/HutchTests/AppStateTests.swift +++ b/HutchTests/AppStateTests.swift @@ -33,4 +33,46 @@ struct AppStateTests { #expect(appState.selectedTab == .more) #expect(appState.pendingTabNavigation == .systemStatus) } + + @Test + @MainActor + func navigationHelpersQueueExpectedTargets() { + let appState = AppState() + let repository = RepositorySummary( + id: 1, + rid: "repo", + service: .git, + name: "hutch", + description: nil, + visibility: .public, + updated: .distantPast, + owner: Entity(canonicalName: "~owner"), + head: nil + ) + let tracker = TrackerSummary( + id: 2, + rid: "tracker", + name: "todo", + description: nil, + visibility: .public, + updated: .distantPast, + owner: Entity(canonicalName: "~owner") + ) + + appState.navigateToRepository(repository) + #expect(appState.selectedTab == .repositories) + #expect(appState.pendingTabNavigation == .repository(repository)) + + appState.navigateToTracker(tracker) + #expect(appState.selectedTab == .tickets) + #expect(appState.pendingTabNavigation == .tracker(tracker)) + + appState.navigateToBuild(jobId: 42) + #expect(appState.selectedTab == .builds) + #expect(appState.pendingDeepLink == .build(jobId: 42)) + + appState.navigateToTicket(ownerUsername: "owner", trackerName: "todo", ticketId: 9) + #expect(appState.selectedTab == .tickets) + #expect(appState.pendingDeepLink == .ticket(owner: "owner", tracker: "todo", ticketId: 9)) + } } |
