tercul-backend/internal/adapters/graphql
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
..
model refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +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
binding.go feat(analytics): Enhance analytics capabilities 2025-09-07 19:26:51 +00:00
generated.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
graphql_test_utils_test.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
helpers.go This commit introduces goose as the database migration tool for the project, replacing the previous gorm.AutoMigrate system. It also includes several code quality improvements identified during the refactoring process. 2025-10-03 02:52:01 +00:00
integration_test.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
like_resolvers_unit_test.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
resolver.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
schema.graphqls refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
schema.resolvers.go refactor: Refactor GraphQL tests to use mock-based unit tests 2025-10-03 09:21:41 +00:00
validation.go feat(analytics): Enhance analytics capabilities 2025-09-07 19:26:51 +00:00