diff options
| author | Christian Cleberg <[email protected]> | 2026-04-13 20:07:53 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-13 20:07:53 -0500 |
| commit | 312e535f400f31714b3750de5222a1f6a8e5bcda (patch) | |
| tree | dfa0d9dfcfd08187befa79cf5d8afc4da9fef860 /HutchTests | |
| parent | fe1ccc69661603d419a642a450e4ac9e1258adb0 (diff) | |
| download | hutch-3.1.4.tar.gz hutch-3.1.4.tar.bz2 hutch-3.1.4.zip | |
fix: sonarqube code smell fixesv3.1.4
Diffstat (limited to 'HutchTests')
| -rw-r--r-- | HutchTests/AppStateTests.swift | 22 | ||||
| -rw-r--r-- | HutchTests/ProjectTests.swift | 12 | ||||
| -rw-r--r-- | HutchTests/RepositoryACLViewModelTests.swift | 20 | ||||
| -rw-r--r-- | HutchTests/RepositoryListViewModelTests.swift | 20 | ||||
| -rw-r--r-- | HutchTests/RepositorySettingsViewModelTests.swift | 20 | ||||
| -rw-r--r-- | HutchTests/SRHTWebURLTests.swift | 22 | ||||
| -rw-r--r-- | HutchTests/TrackerListViewModelTests.swift | 2 |
7 files changed, 64 insertions, 54 deletions
diff --git a/HutchTests/AppStateTests.swift b/HutchTests/AppStateTests.swift index fe357cb..a5661ef 100644 --- a/HutchTests/AppStateTests.swift +++ b/HutchTests/AppStateTests.swift @@ -39,22 +39,24 @@ struct AppStateTests { 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 + fields: .init( + id: 1, + rid: "repo", + service: .git, + name: "hutch", + description: nil, + visibility: .publicVisibility, + updated: .distantPast, + owner: Entity(canonicalName: "~owner"), + head: nil + ) ) let tracker = TrackerSummary( id: 2, rid: "tracker", name: "todo", description: nil, - visibility: .public, + visibility: .publicVisibility, updated: .distantPast, owner: Entity(canonicalName: "~owner") ) diff --git a/HutchTests/ProjectTests.swift b/HutchTests/ProjectTests.swift index 0323f25..23faa0d 100644 --- a/HutchTests/ProjectTests.swift +++ b/HutchTests/ProjectTests.swift @@ -15,7 +15,7 @@ struct ProjectTests { name: "Hutch", description: nil, website: nil, - visibility: .public, + visibility: .publicVisibility, tags: [], updated: Date(timeIntervalSince1970: 0) ), @@ -25,7 +25,7 @@ struct ProjectTests { id: "list-1", name: "hutch-devel", description: nil, - visibility: .public, + visibility: .publicVisibility, owner: Entity(canonicalName: "~owner") ) ], @@ -34,7 +34,7 @@ struct ProjectTests { id: "repo-1", name: "hutch", description: nil, - visibility: .public, + visibility: .publicVisibility, owner: Entity(canonicalName: "~owner"), repoType: .git ), @@ -42,7 +42,7 @@ struct ProjectTests { id: "repo-2", name: "hutch-web", description: nil, - visibility: .public, + visibility: .publicVisibility, owner: Entity(canonicalName: "~owner"), repoType: .git ) @@ -52,7 +52,7 @@ struct ProjectTests { id: "tracker-1", name: "bugs", description: nil, - visibility: .public, + visibility: .publicVisibility, owner: Entity(canonicalName: "~owner") ) ], @@ -71,7 +71,7 @@ struct ProjectTests { name: "Docs", description: nil, website: Fixture.exampleWebsite, - visibility: .public, + visibility: .publicVisibility, tags: [], updated: Date(timeIntervalSince1970: 0) ), diff --git a/HutchTests/RepositoryACLViewModelTests.swift b/HutchTests/RepositoryACLViewModelTests.swift index 9c3f929..9640b93 100644 --- a/HutchTests/RepositoryACLViewModelTests.swift +++ b/HutchTests/RepositoryACLViewModelTests.swift @@ -110,15 +110,17 @@ struct RepositoryACLViewModelTests { @MainActor private func makeRepository() -> RepositorySummary { RepositorySummary( - id: 1, - rid: "rid-1", - service: .git, - name: "repo", - description: nil, - visibility: .public, - updated: .now, - owner: Entity(canonicalName: "~owner"), - head: nil + fields: .init( + id: 1, + rid: "rid-1", + service: .git, + name: "repo", + description: nil, + visibility: .publicVisibility, + updated: .now, + owner: Entity(canonicalName: "~owner"), + head: nil + ) ) } } diff --git a/HutchTests/RepositoryListViewModelTests.swift b/HutchTests/RepositoryListViewModelTests.swift index 07f66aa..5fe3974 100644 --- a/HutchTests/RepositoryListViewModelTests.swift +++ b/HutchTests/RepositoryListViewModelTests.swift @@ -79,15 +79,17 @@ struct RepositoryListViewModelTests { branch: String = "main" ) -> RepositorySummary { RepositorySummary( - id: id, - rid: "rid-\(id)", - service: service, - name: name, - description: description, - visibility: .public, - updated: Date(timeIntervalSince1970: TimeInterval(id)), - owner: Entity(canonicalName: owner), - head: Reference(name: branch, target: nil) + fields: .init( + id: id, + rid: "rid-\(id)", + service: service, + name: name, + description: description, + visibility: .publicVisibility, + updated: Date(timeIntervalSince1970: TimeInterval(id)), + owner: Entity(canonicalName: owner), + head: Reference(name: branch, target: nil) + ) ) } } diff --git a/HutchTests/RepositorySettingsViewModelTests.swift b/HutchTests/RepositorySettingsViewModelTests.swift index 3b76da1..e64e08f 100644 --- a/HutchTests/RepositorySettingsViewModelTests.swift +++ b/HutchTests/RepositorySettingsViewModelTests.swift @@ -118,15 +118,17 @@ struct RepositorySettingsViewModelTests { @MainActor private func makeRepository(headName: String?) -> RepositorySummary { RepositorySummary( - id: 1, - rid: "rid-1", - service: .git, - name: "repo", - description: "desc", - visibility: .public, - updated: .now, - owner: Entity(canonicalName: "~owner"), - head: headName.map { Reference(name: $0, target: nil) } + fields: .init( + id: 1, + rid: "rid-1", + service: .git, + name: "repo", + description: "desc", + visibility: .publicVisibility, + updated: .now, + owner: Entity(canonicalName: "~owner"), + head: headName.map { Reference(name: $0, target: nil) } + ) ) } } diff --git a/HutchTests/SRHTWebURLTests.swift b/HutchTests/SRHTWebURLTests.swift index c1f0dc0..d1053e6 100644 --- a/HutchTests/SRHTWebURLTests.swift +++ b/HutchTests/SRHTWebURLTests.swift @@ -14,22 +14,24 @@ struct SRHTWebURLTests { } private let repository = RepositorySummary( - id: 1, - rid: "repo-1", - service: .git, - name: "hutch", - description: nil, - visibility: .public, - updated: .distantPast, - owner: Entity(canonicalName: "~ccleberg"), - head: nil + fields: .init( + id: 1, + rid: "repo-1", + service: .git, + name: "hutch", + description: nil, + visibility: .publicVisibility, + updated: .distantPast, + owner: Entity(canonicalName: "~ccleberg"), + head: nil + ) ) private let tracker = TrackerSummary( id: 2, rid: "tracker-1", name: "todo", description: nil, - visibility: .public, + visibility: .publicVisibility, updated: .distantPast, owner: Entity(canonicalName: "~ccleberg") ) diff --git a/HutchTests/TrackerListViewModelTests.swift b/HutchTests/TrackerListViewModelTests.swift index 7e927af..5c57e04 100644 --- a/HutchTests/TrackerListViewModelTests.swift +++ b/HutchTests/TrackerListViewModelTests.swift @@ -66,7 +66,7 @@ struct TrackerListViewModelTests { rid: "rid-\(id)", name: name, description: description, - visibility: .public, + visibility: .publicVisibility, updated: Date(), owner: Entity(canonicalName: owner) ) |
