-
Notifications
You must be signed in to change notification settings - Fork 4
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
Handling Leap Year Issue and more #126
Open
NavyStack
wants to merge
4
commits into
rendall:master
Choose a base branch
from
NavyStack:dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 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 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 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 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 |
---|---|---|
|
@@ -13,10 +13,13 @@ describe("Test crypt", () => { | |
it("Test auth token", async () => { | ||
const name = "Rendall" | ||
const token = getAuthToken(name) | ||
|
||
|
||
// Use a defined JWT_SECRET or a default for testing | ||
const jwtSecret = process.env.JWT_SECRET || "default_test_secret" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good idea! |
||
|
||
const claim: TokenClaim = (await jwt.verify( | ||
token, | ||
process.env.JWT_SECRET | ||
jwtSecret | ||
)) as { | ||
user: UserId | ||
exp: number | ||
|
@@ -29,4 +32,4 @@ describe("Test crypt", () => { | |
|
||
expect(expirationDate.getFullYear()).toBe(nowDate.getFullYear() + 1) | ||
}) | ||
}) | ||
}) |
This file contains 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 |
---|---|---|
|
@@ -150,35 +150,35 @@ describe("debounce", () => { | |
}) | ||
|
||
describe("longFormatDate", () => { | ||
const localesArr = [ | ||
["af-ZA", "23 Julie 2023 13:31"], | ||
const localesArr = [ // ISO 8601 | ||
["af-ZA", "23 Julie 2023 om 13:31"], | ||
["ar-SA", "٥ محرم ١٤٤٥ هـ في ١:٣١ م"], | ||
["de-DE", "23. Juli 2023 um 13:31"], | ||
["el-GR", "23 Ιουλίου 2023 - 1:31 μ.μ."], | ||
["el-GR", "23 Ιουλίου 2023 στις 1:31 μ.μ."], | ||
["en-AU", "23 July 2023 at 1:31 pm"], | ||
["en-GB", "23 July 2023 at 13:31"], | ||
["en-IN", "23 July 2023 at 1:31 pm"], | ||
["en-US", "July 23, 2023 at 1:31 PM"], | ||
["es-ES", "23 de julio de 2023, 13:31"], | ||
["es-MX", "23 de julio de 2023, 13:31"], | ||
["es-MX", "23 de julio de 2023, 1:31 p.m."], | ||
["fi-FI", "23. heinäkuuta 2023 klo 13.31"], | ||
["fr-CA", "23 juillet 2023 à 13 h 31"], | ||
["fr-FR", "23 juillet 2023 à 13:31"], | ||
["he-IL", "23 ביולי 2023 בשעה 13:31"], | ||
["hi-IN", "23 जुलाई 2023 को 1:31 pm"], | ||
["id-ID", "23 Juli 2023 13.31"], | ||
["it-IT", "23 luglio 2023 13:31"], | ||
["hi-IN", "23 जुलाई 2023 को 1:31 pm बजे"], | ||
["id-ID", "23 Juli 2023 pukul 13.31"], | ||
["it-IT", "23 luglio 2023 alle ore 13:31"], | ||
Comment on lines
-168
to
+170
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confused about these. These tests pass on my box and in the Github actions. Are they not passing for you? |
||
["ja-JP", "2023年7月23日 13:31"], | ||
["ko-KR", "2023년 7월 23일 오후 1:31"], | ||
["nl-NL", "23 juli 2023 om 13:31"], | ||
["pl-PL", "23 lipca 2023 13:31"], | ||
["pt-BR", "23 de julho de 2023 13:31"], | ||
["pt-BR", "23 de julho de 2023 às 13:31"], | ||
["pt-PT", "23 de julho de 2023 às 13:31"], | ||
["ru-RU", "23 июля 2023 г., 13:31"], | ||
["sv-SE", "23 juli 2023 13:31"], | ||
["th-TH", "23 กรกฎาคม 2566 13:31"], | ||
["ru-RU", "23 июля 2023 г. в 13:31"], | ||
["sv-SE", "23 juli 2023 kl. 13:31"], | ||
["th-TH", "23 กรกฎาคม 2566 เวลา 13:31"], | ||
["tr-TR", "23 Temmuz 2023 13:31"], | ||
["vi-VN", "13:31 23 tháng 7, 2023"], | ||
["vi-VN", "lúc 13:31 23 tháng 7, 2023"], | ||
["zh-CN", "2023年7月23日 13:31"], | ||
["zh-TW", "2023年7月23日 下午1:31"], | ||
] | ||
|
@@ -211,4 +211,11 @@ describe("longFormatDate", () => { | |
const result = longFormatDate(date) | ||
expect(result).toBe("Invalid Date") | ||
}) | ||
}) | ||
|
||
it("should handle incorrect string date format", () => { | ||
const date = "2023-07-32" // Invalidly formatted date | ||
const result = longFormatDate(date) | ||
expect(result).toBe("Invalid Date") | ||
}) | ||
|
||
}) |
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.
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.
👍🏻
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.
I like the simplification and comments here. House style is to avoid a return statement when there are no local variables nor otherwise any need for a command block (curly brackets).