airqo-platform / airqo-platform/AirQo-api
[Auth Service] Add test coverage for new database functions in CQRS implementation
- Dominant language
- JavaScript
- Stars
- 26
- Forks
- 24
- Avg merge
- 5h 36m
- Merged PRs (30d)
- 81
Description
## Background
In PR #4512, we introduced CQRS pattern support with dual database connections in the Auth Service. CodeRabbit identified that several of the new database functions lack test coverage.
## Required Action
Add thorough tests for the following new database functions:
- `getCommandTenantDB`
- `getQueryTenantDB`
- `getCommandModelByTenant`
- `getQueryModelByTenant`
## Importance
Since database operations are critical to the application, these functions must be comprehensively covered with tests that validate both successful paths (e.g., correct database connection and model registration) and failure conditions (e.g., when a connection is not established).
## References
- PR: https://github.com/airqo-platform/AirQo-api/pull/4512
- Comment: https://github.com/airqo-platform/AirQo-api/pull/4512#discussion_r1977705059
## Requested by
@Baalmart
Contributor guide
Assessment
This issue has not been assessed yet.