summaryrefslogtreecommitdiff
path: root/HutchTests/TicketDetailViewModelTests.swift
blob: bf0bc609ea5b160b5950d2f176625f31f4d35c5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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)
    }
}