krz/hutch

an ios client for sourcehut

clone: git clone https://gitbay.org/krz/hutch.git

v3.1.4: HutchTests/TicketDetailViewModelTests.swift · raw

 1import Foundation
 2import Testing
 3@testable import Hutch
 4
 5struct TicketDetailViewModelTests {
 6
 7    @Test
 8    @MainActor
 9    func reopenStatusInputOmitsResolution() {
10        let input = TicketDetailViewModel.statusUpdateInput(
11            status: .reported,
12            resolution: .unresolved
13        )
14
15        #expect(input["status"] as? String == TicketStatus.reported.rawValue)
16        #expect(input["resolution"] == nil)
17    }
18
19    @Test
20    @MainActor
21    func resolveStatusInputIncludesResolution() {
22        let input = TicketDetailViewModel.statusUpdateInput(
23            status: .resolved,
24            resolution: .fixed
25        )
26
27        #expect(input["status"] as? String == TicketStatus.resolved.rawValue)
28        #expect(input["resolution"] as? String == TicketResolution.fixed.rawValue)
29    }
30}