-
Notifications
You must be signed in to change notification settings - Fork 153
feat: <1 year GitHub red flag for new joiner #549
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
sahsisunny
merged 12 commits into
RealDevSquad:develop
from
ravikumar1002:feat/within-1y-github-user
Aug 15, 2023
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
827dbce
feat: <1 year github red flag for new joiner
ravikumar1002 d587f87
add: change more then year ago with actual year
ravikumar1002 58d411f
fix: year word with years
ravikumar1002 52d0819
fix: optional chaining for github_created_at
ravikumar1002 b22ef7b
Merge branch 'develop' of https://github.com/ravikumar1002/website-ww…
ravikumar1002 1adfadc
test for dateDifference function | utils.js
ravikumar1002 83966fd
remove console.log
ravikumar1002 265e0ae
increase timeout for test
ravikumar1002 31417d6
fix: data passing way in function
ravikumar1002 d6ca4a4
fix: typo error
ravikumar1002 bd6be55
fix: lint problem
ravikumar1002 4709efc
remove console.log | intro.js
ravikumar1002 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| const timeout = 15000; | ||
| const timeout = 25000; | ||
|
|
||
| describe('Dummy Test ', () => { | ||
| beforeAll(async () => { | ||
|
|
||
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,37 @@ | ||
| const utils = require('../js/utils'); | ||
|
|
||
| describe('Utils function test case', () => { | ||
| describe('Difference between two dates', function () { | ||
| test('should handle negative differences correctly', () => { | ||
| const startDate = 1691260200000; // 6 August 2023 | ||
| const endDate = 1674153000000; // 20 January 2023 | ||
| const difference = utils.dateDifference(startDate, endDate); | ||
|
|
||
| expect(difference).toEqual({ years: 0, months: 6, days: 17 }); | ||
| }); | ||
|
|
||
| test('should return correct date difference object', () => { | ||
| const startDate = 1674153000000; // 20 January 2023 | ||
| const endDate = 1691260200000; // 6 August 2023 | ||
| const difference = utils.dateDifference(startDate, endDate); | ||
|
|
||
| expect(difference).toEqual({ years: 0, months: 6, days: 17 }); | ||
| }); | ||
|
|
||
| test('should handle date in the same month correctly', () => { | ||
| const startDate = 1674153000000; // 20 January 2023 | ||
| const endDate = 1674844200000; // 28 January 2023 | ||
| const difference = utils.dateDifference(startDate, endDate); | ||
|
|
||
| expect(difference).toEqual({ years: 0, months: 0, days: 8 }); | ||
| }); | ||
|
|
||
| test('should handle date in different years correctly', () => { | ||
| const startDate = 1640889000000; // 31 December 2021 | ||
| const endDate = 1640975400000; // 1 January 2022 | ||
| const difference = utils.dateDifference(startDate, endDate); | ||
|
|
||
| expect(difference).toEqual({ years: 0, months: 0, days: 1 }); | ||
| }); | ||
| }); | ||
| }); |
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
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.