-
Notifications
You must be signed in to change notification settings - Fork 7
Fixed date issue with calendar test #174
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
Conversation
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.
Please fix naming and duplication. Also adding a comment on what needs to be considered in regards to time mocking and asserts would great for future reference.
cypress/component/Calendar.cy.js
Outdated
cy.clock(); | ||
cy.tick(timestamp); | ||
|
||
const now = new Date(timestamp); |
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.
Please use a more descriptive name than now
, either mockNow
, mockTestDate
or something even better.
cypress/component/Calendar.cy.js
Outdated
}); | ||
|
||
it("Calendar multiple days", () => { | ||
const timestamp = 60 * 60 * 1000 * 8; |
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.
Add comment explaining the choice of math :-)
Consider changing timestamp
to a more descriptive name
cypress/component/Calendar.cy.js
Outdated
}); | ||
|
||
it("Calendar multiple", () => { | ||
const timestamp = 60 * 60 * 1000 * 8; |
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.
As above
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.
Also. Is it necessary to duplicate code?
cypress/component/Calendar.cy.js
Outdated
@@ -682,6 +745,13 @@ describe("Calendar", () => { | |||
}); | |||
|
|||
it("Calendar single", () => { | |||
const timestamp = 60 * 60 * 1000 * 8; |
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.
As above
Link to ticket
https://leantime.itkdev.dk/#/tickets/showTicket/4084
Description
Fixed date issue with calendar test
Checklist