diff options
| author | Christian Cleberg <[email protected]> | 2026-03-18 20:07:59 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-03-18 20:07:59 -0500 |
| commit | 90da3a7aa2bf991904c1d7201250154ea84f1493 (patch) | |
| tree | 6bf5b8ecb267b051e865e615e121b9357b6f2966 /HutchTests/TicketDetailViewModelTests.swift | |
| parent | 090c829a5f800266da7f4ff0e59fb389f0dbfdd8 (diff) | |
| download | hutch-90da3a7aa2bf991904c1d7201250154ea84f1493.tar.gz hutch-90da3a7aa2bf991904c1d7201250154ea84f1493.tar.bz2 hutch-90da3a7aa2bf991904c1d7201250154ea84f1493.zip | |
Omit resolution when reopening resolved tickets
Diffstat (limited to 'HutchTests/TicketDetailViewModelTests.swift')
| -rw-r--r-- | HutchTests/TicketDetailViewModelTests.swift | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/HutchTests/TicketDetailViewModelTests.swift b/HutchTests/TicketDetailViewModelTests.swift new file mode 100644 index 0000000..bf0bc60 --- /dev/null +++ b/HutchTests/TicketDetailViewModelTests.swift @@ -0,0 +1,30 @@ +import Foundation +import Testing +@testable import Hutch + +struct TicketDetailViewModelTests { + + @Test + @MainActor + func reopenStatusInputOmitsResolution() { + let input = TicketDetailViewModel.statusUpdateInput( + status: .reported, + resolution: .unresolved + ) + + #expect(input["status"] as? String == TicketStatus.reported.rawValue) + #expect(input["resolution"] == nil) + } + + @Test + @MainActor + func resolveStatusInputIncludesResolution() { + let input = TicketDetailViewModel.statusUpdateInput( + status: .resolved, + resolution: .fixed + ) + + #expect(input["status"] as? String == TicketStatus.resolved.rawValue) + #expect(input["resolution"] as? String == TicketResolution.fixed.rawValue) + } +} |
