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

test(common): make date pipe tests work in more timezones #21379

Closed
wants to merge 1 commit into from

Conversation

ocombe
Copy link
Contributor

@ocombe ocombe commented Jan 8, 2018

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[x] Other... Please describe: tests

What is the current behavior?

Some date pipe tests use a time that will return a different date depending on the timezone of the machine running the tests

Issue Number: #21112

What is the new behavior?

We set the time to 12h00 so that the test passes in all timezones

Does this PR introduce a breaking change?

[x] No

@ocombe ocombe added target: patch This PR is targeted for the next patch release area: common Issues related to APIs in the @angular/common package labels Jan 8, 2018
@ocombe
Copy link
Contributor Author

ocombe commented Jan 8, 2018

Travis fails because of the application size (that fails on master), it has nothing to do with my PR

@ocombe ocombe requested a review from vicb January 8, 2018 09:45

it('should format invalid in Safari ISO date',
() => expect(pipe.transform('2017-01-20T19:00:00+0000')).toEqual('Jan 20, 2017'));
() => expect(pipe.transform('2017-01-20T12:00:00+0000')).toEqual('Jan 20, 2017'));

Copy link

Choose a reason for hiding this comment

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

12 pm UTC is actually 1 am on Jan 21st in NZDT (+13:00) so "most" time zones.

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 point, I've updated the commit message :)
we could also handle this programmatically, we can get the timezone and change the expected result.

@ocombe ocombe added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 8, 2018
@ocombe ocombe unassigned vicb Jan 8, 2018
@ocombe ocombe changed the title test(common): make date pipe tests work in all timezones test(common): make date pipe tests work in more timezones Jan 8, 2018
@vicb vicb added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 11, 2018
@alexeagle alexeagle closed this in 246de65 Jan 12, 2018
@ocombe ocombe deleted the fix/#21112-date-pipe-tests branch January 19, 2018 09:38
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: common Issues related to APIs in the @angular/common package area: i18n cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants