HutchTests/TicketDetailViewModelTests.swift

9e6ec710861994439ab9eb56949da4f7ffa512ff
hutch/HutchTests/TicketDetailViewModelTests.swift history · blame · raw

30 lines · 811 bytes

 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}