|
1 | 1 | import XCTest |
2 | 2 | @testable import Omi_Computer |
3 | 3 |
|
4 | | -/// Tests for polling frequency reduction (#6500). |
5 | | -/// Verifies that polling intervals are at their target values (120s) |
6 | | -/// and that the activation cooldown logic works correctly. |
| 4 | +/// Tests for event-driven refresh architecture (#6500). |
| 5 | +/// Verifies that all periodic polling timers have been removed and |
| 6 | +/// that activation cooldown logic works correctly. |
7 | 7 | final class PollingFrequencyTests: XCTestCase { |
8 | 8 |
|
9 | | - // MARK: - Polling Interval Constants |
| 9 | + // MARK: - No Polling Timers |
10 | 10 |
|
11 | | - func testChatPollIntervalIs120Seconds() { |
12 | | - // ChatProvider.messagePollInterval is private, so verify via the config constant |
13 | | - XCTAssertEqual(PollingConfig.chatPollInterval, 120.0, "Chat poll interval should be 120s") |
14 | | - } |
15 | | - |
16 | | - func testTasksPollIntervalIs120Seconds() { |
17 | | - XCTAssertEqual(PollingConfig.tasksPollInterval, 120.0, "Tasks poll interval should be 120s") |
18 | | - } |
19 | | - |
20 | | - func testMemoriesPollIntervalIs120Seconds() { |
21 | | - XCTAssertEqual(PollingConfig.memoriesPollInterval, 120.0, "Memories poll interval should be 120s") |
22 | | - } |
23 | | - |
24 | | - func testConversationsPollIntervalIs120Seconds() { |
25 | | - XCTAssertEqual(PollingConfig.conversationsPollInterval, 120.0, "Conversations poll interval should be 120s") |
| 11 | + func testPollingConfigHasNoPollIntervals() { |
| 12 | + // PollingConfig should only contain activationCooldown — no poll intervals. |
| 13 | + // If someone adds a poll interval constant, this test must be updated. |
| 14 | + XCTAssertEqual(PollingConfig.activationCooldown, 60.0, "Activation cooldown should be 60s") |
26 | 15 | } |
27 | 16 |
|
28 | 17 | // MARK: - Activation Cooldown |
@@ -62,4 +51,12 @@ final class PollingFrequencyTests: XCTestCase { |
62 | 51 | let elapsed = now.timeIntervalSince(lastRefresh) |
63 | 52 | XCTAssertGreaterThanOrEqual(elapsed, PollingConfig.activationCooldown) |
64 | 53 | } |
| 54 | + |
| 55 | + // MARK: - Refresh All Notification |
| 56 | + |
| 57 | + func testRefreshAllDataNotificationNameExists() { |
| 58 | + // Verify the notification name is defined (Cmd+R triggers this) |
| 59 | + let name = Notification.Name.refreshAllData |
| 60 | + XCTAssertEqual(name.rawValue, "refreshAllData") |
| 61 | + } |
65 | 62 | } |
0 commit comments