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

WAITP-1269: Fix front end tests config #4726

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

tcaiger
Copy link
Contributor

@tcaiger tcaiger commented Jul 12, 2023

Issue #: WAITP-1269: Fix front end tests

Changes:

  • Updates to moment-timezone meant that the timezone wasn't getting set correctly at the start of period granularity tests. Fixed by setting the timezone through jest config instead.


const DATE_FORMAT = 'YYYY-MM-DD';

export const formatDateForApi = (date, timezone) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The timezone prop was never being used and removing support for it means that we can completely remove moment-timezone as a dependency from web-frontend.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice one. There is actually a function in utils called formatDateForApi which looks like it does the same thing. Might not be worth swapping it out tho, since we are going to eventually get rid of web-frontend

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spotting but yeah probably not worth it at this point in web-frontend.

@tcaiger tcaiger changed the title WAITP-1269: Fix front end tests WAITP-1269: Fix front end tests config Jul 12, 2023
Copy link
Contributor

@alexd-bes alexd-bes left a comment

Choose a reason for hiding this comment

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

Nice one, thanks for doing this!


const DATE_FORMAT = 'YYYY-MM-DD';

export const formatDateForApi = (date, timezone) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice one. There is actually a function in utils called formatDateForApi which looks like it does the same thing. Might not be worth swapping it out tho, since we are going to eventually get rid of web-frontend

@tcaiger tcaiger merged commit 4cfd152 into epic-frontend-rewrite Jul 12, 2023
@tcaiger tcaiger deleted the waitp-1269-fix-fe-tests branch July 12, 2023 04:04
tcaiger added a commit that referenced this pull request Jul 12, 2023
tcaiger added a commit that referenced this pull request Jul 12, 2023
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.

2 participants