Repository navigation
Dev #2170
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
Merged
Dev #2170
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3fbf681
feat(monitoring): scrape the notification system services
LeonardoVieira1630 5c3da3b
feat(observability): shared HTTP server metrics helpers and Fastify p…
LeonardoVieira1630 20c4b8d
Merge pull request #2165 from blockful/feat/monitoring-notification-s…
LeonardoVieira1630 f705ff8
fix(dashboard): respect each SPP program's report deadline
alextnetto ac8e8a0
feat(dashboard): add Shutter Security Council card
alextnetto 491cc4d
refactor(dashboard): derive council "no expiration" from timestamp 0
alextnetto 68414b8
fix(dashboard): stop the whitelabel delegates table clipping the Dele…
brunod-e 6910a42
Merge pull request #2167 from blockful/fix/spp-report-due-days
brunod-e d0000d5
Merge branch 'dev' into feat/shutter-security-council-card
brunod-e c41e3dc
Merge branch 'dev' into fix/whitelabel-delegate-column
brunod-e ce72613
Merge pull request #2168 from blockful/feat/shutter-security-council-…
brunod-e 357b4be
Merge pull request #2169 from blockful/fix/whitelabel-delegate-column
brunod-e 96599ae
chore: version packages
github-actions[bot] 7c71ed3
Merge pull request #2166 from blockful/changeset-release/dev
brunod-e File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
apps/dashboard/features/service-providers/utils/computeQuarterStatus.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import { | ||
| computeQuarterStatus, | ||
| getDueDate, | ||
| getDueDateLabel, | ||
| } from "@/features/service-providers/utils/computeQuarterStatus"; | ||
|
|
||
| describe("getDueDate", () => { | ||
| test("defaults to the last second of the quarter", () => { | ||
| expect(getDueDate(2026, "Q3").toISOString()).toBe( | ||
| "2026-09-30T23:59:59.000Z", | ||
| ); | ||
| }); | ||
|
|
||
| test("adds the program's report window after the quarter ends", () => { | ||
| expect(getDueDate(2026, "Q3", 30).toISOString()).toBe( | ||
| "2026-10-30T23:59:59.000Z", | ||
| ); | ||
| }); | ||
|
|
||
| test("rolls a Q4 report window into the next year", () => { | ||
| expect(getDueDate(2026, "Q4", 30).toISOString()).toBe( | ||
| "2027-01-30T23:59:59.000Z", | ||
| ); | ||
| }); | ||
| }); | ||
|
|
||
| describe("getDueDateLabel", () => { | ||
| test("labels the quarter end when there is no report window", () => { | ||
| expect(getDueDateLabel(2026, "Q3")).toBe("Due by Sep 30"); | ||
| }); | ||
|
|
||
| test("labels the actual deadline when there is a report window", () => { | ||
| expect(getDueDateLabel(2026, "Q3", 30)).toBe("Due by Oct 30"); | ||
| expect(getDueDateLabel(2026, "Q4", 30)).toBe("Due by Jan 30"); | ||
| }); | ||
| }); | ||
|
|
||
| describe("computeQuarterStatus", () => { | ||
| const oct5 = new Date("2026-10-05T12:00:00Z"); | ||
|
|
||
| test("is overdue the day after the quarter ends without a report window", () => { | ||
| expect(computeQuarterStatus(2026, "Q3", oct5)).toBe("overdue"); | ||
| }); | ||
|
|
||
| test("is still due soon inside the program's report window", () => { | ||
| expect(computeQuarterStatus(2026, "Q3", oct5, 30)).toBe("due_soon"); | ||
| }); | ||
|
|
||
| test("is overdue once the report window has passed", () => { | ||
| expect( | ||
| computeQuarterStatus(2026, "Q3", new Date("2026-10-31T00:00:00Z"), 30), | ||
| ).toBe("overdue"); | ||
| }); | ||
|
|
||
| test("is upcoming more than 30 days before the deadline", () => { | ||
| expect( | ||
| computeQuarterStatus(2026, "Q3", new Date("2026-09-28T00:00:00Z"), 30), | ||
| ).toBe("upcoming"); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.