Skip to content
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

Attempt to fix spec that breaks on last day of the month #4541

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

martijnrusschen
Copy link
Member

No description provided.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ This pull request was sent to the PullRequest network.


Check the status or cancel PullRequest code review here.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PullRequest Breakdown

Reviewable lines of change

+ 1
- 1

100% JavaScript (tests)

Type of change

Fix - These changes are likely to be fixing a bug or issue.
1 Message
📚 It looks like the description for this pull request is either blank or very short. Adding a high-level summary will help our reviewers provide better feedback. Feel free to include questions for PullRequest reviewers and make specific feedback requests.

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.45%. Comparing base (a4b5ac8) to head (e67e6e8).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4541   +/-   ##
=======================================
  Coverage   95.45%   95.45%           
=======================================
  Files          29       29           
  Lines        2533     2533           
  Branches     1039     1039           
=======================================
  Hits         2418     2418           
  Misses        115      115           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may not choose to take action this commit, but I suggested you might consider expanding your use of fixed reference dates in your tests.

Image of John G John G


Reviewed with ❤️ by PullRequest

@@ -2102,7 +2102,7 @@ describe("DatePicker", () => {
});

it("should hide the calendar even when the startDate and the endDate is same in the range", async () => {
let startDate = new Date();
let startDate = new Date("2021-01-21 00:00:00");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like you, I have found that using specific dates in my test cases to be superior to using dates that follow the date of execution of the test.

It may be possible that most of your tests would benefit from having a fixed reference date to prove behavior, especially around edge cases.

◽ Giving Information

Image of John G John G

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes agreed, I will revisit the test to see if we can apply this to more cases. Using a random date or today's date causes a lot of uncertainty in the test cases.

@martijnrusschen martijnrusschen merged commit 8089471 into main Feb 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant