summaryrefslogtreecommitdiff
path: root/HutchTests/TicketBulkActionTests.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-12 22:42:33 -0500
committerChristian Cleberg <[email protected]>2026-04-12 22:42:33 -0500
commit576bb6c2432a15f5138771c06019b55fd2244e15 (patch)
tree167b4704658c11ea6b9e7170390098e13c89b94b /HutchTests/TicketBulkActionTests.swift
parent54d037548261c1546555a89a6a803b542a769880 (diff)
downloadhutch-576bb6c2432a15f5138771c06019b55fd2244e15.tar.gz
hutch-576bb6c2432a15f5138771c06019b55fd2244e15.tar.bz2
hutch-576bb6c2432a15f5138771c06019b55fd2244e15.zip
feat: add ticket label management and bulk actions
Implements: https://todo.sr.ht/~ccleberg/hutch/45 Implements: https://todo.sr.ht/~ccleberg/hutch/46
Diffstat (limited to 'HutchTests/TicketBulkActionTests.swift')
-rw-r--r--HutchTests/TicketBulkActionTests.swift35
1 files changed, 35 insertions, 0 deletions
diff --git a/HutchTests/TicketBulkActionTests.swift b/HutchTests/TicketBulkActionTests.swift
new file mode 100644
index 0000000..2f4d1fd
--- /dev/null
+++ b/HutchTests/TicketBulkActionTests.swift
@@ -0,0 +1,35 @@
+import Testing
+@testable import Hutch
+
+struct TicketBulkActionTests {
+
+ @Test
+ func bulkActionResultFormatsSuccessMessage() {
+ let result = TicketBulkActionResult(
+ action: .close,
+ totalCount: 3,
+ updatedCount: 3,
+ unchangedCount: 0,
+ failures: []
+ )
+
+ #expect(result.title == "Close Complete")
+ #expect(result.message == "Closed 3 tickets.")
+ }
+
+ @Test
+ func bulkActionResultFormatsPartialFailureMessage() {
+ let result = TicketBulkActionResult(
+ action: .assign,
+ totalCount: 4,
+ updatedCount: 2,
+ unchangedCount: 1,
+ failures: [
+ TicketBulkActionFailure(ticketID: 42, message: "Network error")
+ ]
+ )
+
+ #expect(result.title == "Assign Partially Applied")
+ #expect(result.message == "Assigned 2 tickets. 1 already assigned. Failed: #42.")
+ }
+}