HabitRPG / habitica-android

Native Android app for Habitica
GNU General Public License v3.0
1.41k stars 508 forks source link

Add Task model tests #2039

Open danielgomezrico opened 10 months ago

danielgomezrico commented 10 months ago

my Habitica User-ID: 6a5dcf62-46d7-41f6-b4a5-19b1bc8a3784

This PR will add unit tests to the Task model, I saw some issues related to reminders and dates and wanted to add tests to be sure that this logic is working as expected.

Related issues:

Are there any other cases that I should be covering here?

Can you add hacktoberfest-accepted label to this PR please?

danielgomezrico commented 10 months ago

Tests are not passing but its related to main codebase, trying to fix them on https://github.com/HabitRPG/habitica-android/pull/2045

Hafizzle commented 9 months ago

Hey @danielgomezrico,

First off, big thanks for diving into Task model tests! It's really cool to see your initiative in adding unit tests, especially around reminders and dates. This is super important for keeping everything running smoothly.

I've gone through your tests, and they're a solid start – they cover the basic scenarios well. However, we're thinking it might be even better to add some more real-world complexity to these tests. For example:

How about testing how the isDueToday function behaves across different time zones? Maybe throw in some scenarios for leap years or unusual date setups? Testing the function with a variety of task types and configurations could also be really insightful.

These additions would really beef up the robustness of our tests and make sure we're covering as many user scenarios as possible.

Thanks again for your work :)