-
Notifications
You must be signed in to change notification settings - Fork 121
[Local catalog] Catalog Needs Refreshing Warning #16309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
7bb5ded
0c53ee1
2cb9f5c
2b25270
e4153ec
b67f14a
19a75ae
8b959bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -860,4 +860,78 @@ extension POSCatalogSyncCoordinatorTests { | |||||
| // Then - sync should proceed (exactly at 30-day boundary is still eligible) | ||||||
| #expect(mockIncrementalSyncService.startIncrementalSyncCallCount == 1) | ||||||
| } | ||||||
|
|
||||||
| // MARK: - isSyncStale Tests | ||||||
|
|
||||||
| @Test func test_isSyncStale_returns_true_when_no_full_sync_performed() async throws { | ||||||
| // Given - no full sync date set | ||||||
|
|
||||||
| // When | ||||||
| let isStale = await sut.isSyncStale(for: sampleSiteID, maxDays: 7) | ||||||
|
|
||||||
| // Then | ||||||
| #expect(isStale == true) | ||||||
| } | ||||||
|
|
||||||
| @Test func test_isSyncStale_returns_false_when_full_sync_is_recent() async throws { | ||||||
| // Given - last full sync was 3 days ago | ||||||
| let threeDaysAgo = Calendar.current.date(byAdding: .day, value: -3, to: Date())! | ||||||
|
||||||
| let threeDaysAgo = Calendar.current.date(byAdding: .day, value: -3, to: Date())! | |
| let threeDaysAgo = try #require(Calendar.current.date(byAdding: .day, value: -3, to: Date())) |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this test case feels similar to test_isSyncStale_returns_true_when_full_sync_is_old, maybe the last full sync could be like 1 second past the threshold or exactly at the threshold?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit:
test_prefix isn't necessary with Swift Testing in this file, it's confusing when writing with both XCTest and Swift Testing 😅