From 4346adc50f01be7f7322249d32745d119c757ff2 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 15 Jul 2026 19:19:43 -0500 Subject: test: repair stale expectations and request-body capture These tests drifted from the code and went unnoticed because CI never ran them. All four are test-side errors; no app behavior is involved. - TicketListViewModelTests asserted lowercase "resolved"/"fixed"/"reported" against TicketStatus/TicketResolution rawValues, which are uppercase to match the todo.sr.ht GraphQL enums. - HomeViewModelTests expected failedBuilds in ascending id order. Ordering moved to newest-first when sortBuildItemsForTriage landed in 5f6d545; the filtering the test covers is unchanged. - SettingsViewModelTests read request.httpBody inside a URLProtocol, where it is always nil because URLSession moves the body onto httpBodyStream. The stub now reads the body off the stream at capture time. --- HutchTests/TicketListViewModelTests.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'HutchTests/TicketListViewModelTests.swift') diff --git a/HutchTests/TicketListViewModelTests.swift b/HutchTests/TicketListViewModelTests.swift index 7fa5449..a203091 100644 --- a/HutchTests/TicketListViewModelTests.swift +++ b/HutchTests/TicketListViewModelTests.swift @@ -162,8 +162,8 @@ struct TicketListViewModelTests { "status": TicketStatus.resolved.rawValue, "resolution": TicketResolution.fixed.rawValue ] - #expect(input["status"] as? String == "resolved") - #expect(input["resolution"] as? String == "fixed") + #expect(input["status"] as? String == "RESOLVED") + #expect(input["resolution"] as? String == "FIXED") } @Test @@ -172,7 +172,7 @@ struct TicketListViewModelTests { let input: [String: any Sendable] = [ "status": TicketStatus.reported.rawValue ] - #expect(input["status"] as? String == "reported") + #expect(input["status"] as? String == "REPORTED") #expect(input["resolution"] == nil) } -- cgit v1.2.3