Create useSMHIForecast.test.js #926

Merged
a22erigr merged 1 commit from #47-Testing-SMHI into team_2_week_5 2026-05-13 07:27:05 +00:00
Collaborator

Added automated tests for the SMHI forecast hook (useSMHIForecast). The tests verify that the hook:

  • builds the correct SMHI API URL using latitude and longitude
  • passes the refresh dependency correctly forwards fetch options (cache: 'no-store')
  • returns the response from useApi

The tests use mocked dependencies instead of real SMHI API calls to keep the test suite fast and reliable.
All tests are expected to pass.

Added automated tests for the SMHI forecast hook (useSMHIForecast). The tests verify that the hook: - builds the correct SMHI API URL using latitude and longitude - passes the refresh dependency correctly forwards fetch options (cache: 'no-store') - returns the response from useApi The tests use mocked dependencies instead of real SMHI API calls to keep the test suite fast and reliable. All tests are expected to pass.
Added automated tests for the SMHI forecast hook (useSMHIForecast). The tests verify that the hook:

- builds the correct SMHI API URL using latitude and longitude
- passes the refresh dependency correctly
forwards fetch options (cache: 'no-store')
- returns the response from useApi

The tests use mocked dependencies instead of real SMHI API calls to keep the test suite fast and reliable.
a22erigr 2026-05-13 05:58:20 +00:00
b23albst approved these changes 2026-05-13 06:33:03 +00:00
b23albst left a comment
Collaborator

Review on #926

Whats done

Reviewed the code and ran the tests

Tested on ubuntu

  • All tests passed

Inspected following files

  • frontend/src/features/smhi/useSMHIForecast.test.js
    • Indentation/code styling
      • Indentation is ok
    • Naming convention
      • Naming convention ok
    • Comments
      • Comments ok

Conclusion

Since all tests pass and it correctly tests the hook (returned values), this is ready to be merged.

# Review on #926 ## Whats done Reviewed the code and ran the tests ### Tested on ubuntu + All tests passed ### Inspected following files + frontend/src/features/smhi/useSMHIForecast.test.js + Indentation/code styling + Indentation is ok + Naming convention + Naming convention ok + Comments + Comments ok ## Conclusion Since all tests pass and it correctly tests the hook (returned values), this is ready to be merged.
a22erigr merged commit bf510b0b54 into team_2_week_5 2026-05-13 07:27:05 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K!926
No description provided.