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

fix: send requestee and requester correct date and time when timezone… #5924

Merged
merged 7 commits into from
May 27, 2024

Conversation

SebastianKrupinski
Copy link
Contributor

@SebastianKrupinski SebastianKrupinski commented Apr 16, 2024

Send requestee and requester correct date and time when requestee and requester time zones are different.

Fixes #5198

…s differ #5198

Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 23.59%. Comparing base (af94950) to head (f874071).
Report is 114 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5924      +/-   ##
============================================
+ Coverage     23.30%   23.59%   +0.28%     
- Complexity      443      457      +14     
============================================
  Files           247      246       -1     
  Lines         11446    11715     +269     
  Branches       1923     2140     +217     
============================================
+ Hits           2668     2764      +96     
+ Misses         8778     8637     -141     
- Partials          0      314     +314     
Flag Coverage Δ
javascript 15.18% <ø> (+0.58%) ⬆️
php 58.61% <ø> (-0.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Code looks good! Could you please add a to \OCA\Calendar\Tests\Unit\Service\Appointments\MailServiceTest that covers this scenario? Look at \OCA\Calendar\Tests\Unit\Service\Appointments\MailServiceTest::testSendConfirmationEmail. Create a similar test that asserts the values passed to formatDateTimeRelativeDay

Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
$this->lFactory->expects(self::once())
->method('get');
$this->dateFormatter->expects(self::once())
->method('formatDateTimeRelativeDay')
Copy link
Member

Choose a reason for hiding this comment

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

by using ->with(args) you can assert the value of the arguments passed to this method. It will allow you to test if the fourth argument matches the expected timezone value. Same for the new testSendOrganizerBookingInformationEmailDifferentTZ case

Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
Copy link

github-actions bot commented May 1, 2024

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Code looks good!

lib/Service/Appointments/MailService.php Outdated Show resolved Hide resolved
@@ -551,6 +662,7 @@ public function testSendOrganizerBookingInformationEmail(): void {
->method('get');
$this->dateFormatter->expects(self::once())
->method('formatDateTimeRelativeDay')
->with(self::anything(), self::anything(), self::anything(), new \DateTimeZone('Europe/Berlin'))
Copy link
Member

Choose a reason for hiding this comment

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

👍 nice

Co-authored-by: Christoph Wurst <ChristophWurst@users.noreply.github.com>
Signed-off-by: Sebastian Krupinski <165827823+SebastianKrupinski@users.noreply.github.com>
@SebastianKrupinski SebastianKrupinski merged commit 79a0b60 into main May 27, 2024
42 checks passed
@SebastianKrupinski SebastianKrupinski deleted the fix/issue-5198 branch May 27, 2024 11:15
@ChristophWurst
Copy link
Member

@SebastianKrupinski please squash your commits to a reasonable minimum number of commits before merge. It will help us maintain a clean git history, which makes the generation of a changelog a lot easier 🙏

@miaulalala miaulalala added this to the v5.0.0 milestone Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants