Browse Source

Fix Event Info tests.

master
Abhishek Banthia 7 months ago
parent
commit
30a7454879
  1. 2
      Clocker/ClockerUnitTests/EventInfoTests.swift
  2. 4
      Clocker/Events and Reminders/CalendarHandler.swift

2
Clocker/ClockerUnitTests/EventInfoTests.swift

@ -59,7 +59,7 @@ class EventInfoTests: XCTestCase {
isAllDay: false,
meetingURL: nil,
attendeStatus: .accepted)
XCTAssert(mockEventInfo.metadataForMeeting() == "Error",
XCTAssert(mockEventInfo.metadataForMeeting() == "started.",
"Metadata for meeting: \(mockEventInfo.metadataForMeeting()) doesn't match expectation")
}

4
Clocker/Events and Reminders/CalendarHandler.swift

@ -494,7 +494,7 @@ struct EventInfo {
let timeIntervalSinceNowForMeeting = event.startDate.timeIntervalSinceNow
if timeIntervalSinceNowForMeeting <= 0 || event.startDate.shortTimeAgoSinceNow == "0s" {
if timeIntervalSinceNowForMeeting == 0 || event.startDate.shortTimeAgoSinceNow == "0s" {
return "started."
} else if timeIntervalSinceNowForMeeting < 0, timeIntervalSinceNowForMeeting > -300 {
return "started +\(event.startDate.shortTimeAgoSinceNow)."
@ -520,6 +520,6 @@ struct EventInfo {
return "in \(hoursUntil)h"
}
return "Error"
return "started."
}
}

Loading…
Cancel
Save