diff options
| author | Christian Cleberg <[email protected]> | 2026-04-12 11:49:45 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-12 11:49:45 -0500 |
| commit | 9e48e4681487b1c69577c0e9e5f83d8d8225e494 (patch) | |
| tree | 825ce946dac13ad24a123b647722a6cab6c51599 /HutchTests | |
| parent | c0744a35891f89e50ab407a0b8557ce9d5c5e6cc (diff) | |
| download | hutch-9e48e4681487b1c69577c0e9e5f83d8d8225e494.tar.gz hutch-9e48e4681487b1c69577c0e9e5f83d8d8225e494.tar.bz2 hutch-9e48e4681487b1c69577c0e9e5f83d8d8225e494.zip | |
feat: add prioritization of polling hutch-stats for logged in user
Diffstat (limited to 'HutchTests')
| -rw-r--r-- | HutchTests/ContributionCalendarTests.swift | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/HutchTests/ContributionCalendarTests.swift b/HutchTests/ContributionCalendarTests.swift index 4ce2f1f..9e76e42 100644 --- a/HutchTests/ContributionCalendarTests.swift +++ b/HutchTests/ContributionCalendarTests.swift @@ -94,6 +94,30 @@ struct ContributionCalendarTests { } @Test + func selfContributionRequestsIncludeExplicitPrioritySignal() { + let service = HutchStatsService( + configuration: AppConfiguration(), + currentActor: "~alice" + ) + let endDate = ContributionDateParser.parse("2026-04-11")! + let queryItems = service.contributionQueryItems(actor: "~alice", endingOn: endDate) + + #expect(queryItems.contains(URLQueryItem(name: "prioritize", value: "self"))) + } + + @Test + func otherContributionRequestsDoNotIncludePrioritySignal() { + let service = HutchStatsService( + configuration: AppConfiguration(), + currentActor: "~alice" + ) + let endDate = ContributionDateParser.parse("2026-04-11")! + let queryItems = service.contributionQueryItems(actor: "~bob", endingOn: endDate) + + #expect(queryItems.contains(URLQueryItem(name: "prioritize", value: "self")) == false) + } + + @Test func contributionIntensityBucketsMatchProductRules() { #expect(ContributionIntensity(count: 0) == .empty) #expect(ContributionIntensity(count: 1) == .level1) |
