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.
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
BAH 3049 | Samridhi | Fix start date undefined value #716
base: master
Are you sure you want to change the base?
BAH 3049 | Samridhi | Fix start date undefined value #716
Changes from 3 commits
aba45ab
4da660c
29701cd
9eb67c0
0e44945
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
If the currentDate is
2-Oct-2023 (Mon)
, then for Menu optionLast 7 days
, the dates selected automatically should be:26-Sep-2023 (Tue)
to2-Oct-2023 (Mon)
. In this case the startDate month = Sep (and not Oct). But I think your test is checking startDate.getMonth() to be currentDate.getMonth(). That isn't right I think. This test will break on certain days I think. Please reconfirm.It would have been best if somehow tests could be written independent of actual date (today), and instead could be passed something like: If Current Date is X, then option Last 7 Days should show DateA and DateB, and so on. I am guessing that will require a little refactoring if your code, to take currentDate as a parameter, and then do calculations.
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.
Maybe you can otherwise try and use Jasmine clock to mock the current Date. See this ChatGPT discussion I just did regarding this code block (scroll to end for Jasmine clock): https://chat.openai.com/share/42d88843-c43c-4dfc-81bc-6ef80438efbf