Skip to content

Commit 612b864

Browse files
committed
test(computer-use): bind thrown values before native test assertions
1 parent 4f9ca1f commit 612b864

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎apps/desktop/native/computer-use/tests/NativeTests.swift‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ import AppKit
4949
expectError("invalid_arguments") { _ = try runAppCommand(AppCommand(name: "create_reminder", title: " ")) }
5050
expectError("invalid_arguments") { _ = try runAppCommand(AppCommand(name: "create_reminder", title: "Pay rent", priority: 3)) }
5151
var local = Calendar(identifier: .gregorian); local.timeZone = .current
52-
precondition(local.dateComponents([.hour, .minute], from: try eventDate("2027-06-09T07:15:00", "Start", allDay: false)) == DateComponents(hour: 7, minute: 15))
52+
let floating = try eventDate("2027-06-09T07:15:00", "Start", allDay: false)
53+
precondition(local.dateComponents([.hour, .minute], from: floating) == DateComponents(hour: 7, minute: 15))
5354
expectError("invalid_arguments") { _ = try eventDate("2027-06-09 07:15", "Start", allDay: false) }
5455
expectError("invalid_arguments") { _ = try eventDate("2027-06-09T07:15:00+01:00", "Start", allDay: true) }
55-
precondition(try eventDate("2027-06-09T07:15:00+01:00", "Start", allDay: false) == Date(timeIntervalSince1970: 1_812_521_700))
56+
let zoned = try eventDate("2027-06-09T07:15:00+01:00", "Start", allDay: false)
57+
precondition(zoned == Date(timeIntervalSince1970: 1_812_521_700))
5658
expectError("invalid_arguments") { _ = try runAppCommand(AppCommand(name: "create_event", title: "Flight", start: "2027-06-09T08:10:00Z", end: "2027-06-09T07:15:00Z")) }
5759
expectError("invalid_arguments") { _ = try runAppCommand(AppCommand(name: "create_event", title: "Trip", start: "2027-06-01T00:00:00Z", end: "2027-08-01T00:00:00Z")) }
5860
expectError("invalid_arguments") { _ = try runAppCommand(AppCommand(name: "create_contact", jobTitle: "Engineer")) }

0 commit comments

Comments
 (0)