Skip to content

Conversation

@goncalopinto1
Copy link

@goncalopinto1 goncalopinto1 commented Dec 23, 2025

Description

Added unit tests for the locationsProvider and refactored the notifier to support Dependency Injection.

Main changes:

  • Refactored FacultyLocationsNotifier to accept an optional fetcher in its constructor, enabling easier mocking/faking.

  • Created a FakeLocationFetcher class to simulate data loading without depending on physical assets or local storage.

  • Implemented comprehensive test cases covering:

    • Successful data loading and parsing.
    • Handling of empty location lists.
    • Error handling for malformed JSON.
    • Validation of the initial AsyncLoading state.
  • Added some verification for values coming from the JSON like the latitude and longitude (must be real physical values) and id that cannot be negative.


Review checklist

  • Logic changes are covered by the new unit tests.
  • Code follows the project's dependency injection patterns.

Performance

  • No helper functions to return widgets were added.
  • Test resources (ProviderContainer) are properly disposed of in the tear-down phase.

@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 16%. Comparing base (6c970af) to head (0b1cc62).
⚠️ Report is 1 commits behind head on develop.

❌ Your project check has failed because the head coverage (16%) is below the target coverage (70%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #1765    +/-   ##
========================================
- Coverage       60%     16%   -43%     
========================================
  Files            2      46    +44     
  Lines           81     745   +664     
========================================
+ Hits            48     116    +68     
- Misses          33     629   +596     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@goncalopinto1 goncalopinto1 requested a review from a team December 23, 2025 17:03
@goncalopinto1 goncalopinto1 marked this pull request as draft December 26, 2025 19:40
@goncalopinto1 goncalopinto1 marked this pull request as ready for review December 28, 2025 00:55
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