tercul-backend/internal/app
google-labs-jules[bot] 80cfe71e59 refactor: Refactor GraphQL tests to use mock-based unit tests
This commit refactors the GraphQL test suite to resolve persistent build failures and establish a stable, mock-based unit testing environment.

The key changes include:
- Consolidating all GraphQL test helper functions into a single, canonical file (`internal/adapters/graphql/graphql_test_utils_test.go`).
- Removing duplicated test helper code from `integration_test.go` and other test files.
- Creating a new, dedicated unit test file for the `like` and `unlike` mutations (`internal/adapters/graphql/like_resolvers_unit_test.go`) using a mock-based approach.
- Introducing mock services (`MockLikeService`, `MockAnalyticsService`) and updating mock repositories (`MockLikeRepository`, `MockWorkRepository`) in the `internal/testutil` package to support `testify/mock`.
- Adding a `ContextWithUserID` helper function to `internal/platform/auth/middleware.go` to facilitate testing of authenticated resolvers.

These changes resolve the `redeclared in this block` and package collision errors, resulting in a clean and passing test suite. This provides a solid foundation for future Test-Driven Development.
2025-10-03 09:21:41 +00:00
..
analytics refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
auth Refactor: Introduce service layer for application logic 2025-09-09 02:28:25 +00:00
author refactor: Align codebase with DDD architecture to fix build 2025-10-03 01:17:53 +00:00
bookmark refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
category Refactor: Introduce service layer for application logic 2025-09-09 02:28:25 +00:00
collection This commit refactors the GraphQL layer to improve code quality and adhere to the project's target architecture. 2025-10-03 02:13:12 +00:00
comment Refactor: Introduce service layer for application logic 2025-09-09 02:28:25 +00:00
copyright feat: Add unit tests for models, repositories, and services 2025-09-07 11:42:30 +00:00
like refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
localization feat: Finalize DDD refactoring and fix tests 2025-10-03 01:44:47 +00:00
monetization feat: Add unit tests for models, repositories, and services 2025-09-07 11:42:30 +00:00
search feat: Finalize DDD refactoring and fix tests 2025-10-03 01:44:47 +00:00
tag Refactor: Introduce service layer for application logic 2025-09-09 02:28:25 +00:00
translation refactor: Align codebase with DDD architecture to fix build 2025-10-03 01:17:53 +00:00
user Refactor: Introduce service layer for application logic 2025-09-09 02:28:25 +00:00
work refactor: Align codebase with DDD architecture to fix build 2025-10-03 01:17:53 +00:00
.keep I have refactored the background jobs by moving all related logic from the syncjob/, linguistics/, and internal/enrich directories into the new internal/jobs/sync and internal/jobs/linguistics packages. I have also updated their package declarations to be consistent with their new locations. 2025-09-02 15:02:04 +00:00
app.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00