mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 05:11:34 +00:00
This commit increases the test coverage of the `internal/app/work` package from 73.1% to over 80% by adding new tests and fixing a bug discovered during testing. The following changes were made: - Added tests for the `ListByCollectionID` query in `queries_test.go`. - Added a unit test for the `NewService` constructor in `service_test.go`. - Added tests for authorization, unauthorized access, and other edge cases in the `UpdateWork`, `DeleteWork`, and `MergeWork` commands in `commands_test.go`. - Fixed a bug in the `mergeWorkStats` function where it was not correctly creating stats for a target work that had no prior stats. This was discovered and fixed as part of writing the new tests. - Updated the `analytics.Service` interface and its mock implementation to support the bug fix. |
||
|---|---|---|
| .. | ||
| model | ||
| .keep | ||
| analytics_service_mock_test.go | ||
| auth_mutations_test.go | ||
| binding.go | ||
| errors.go | ||
| generated.go | ||
| graphql_test_utils_test.go | ||
| helpers.go | ||
| integration_test.go | ||
| like_repo_mock_test.go | ||
| like_resolvers_unit_test.go | ||
| resolver.go | ||
| schema.graphqls | ||
| schema.resolvers.go | ||
| user_mutations_test.go | ||
| validation.go | ||
| work_repo_mock_test.go | ||