add teams tests

This commit is contained in:
2025-06-14 23:18:05 +07:00
parent 54706f0aba
commit b6e3fb8596
6 changed files with 145 additions and 7 deletions
+6 -1
View File
@@ -4,6 +4,7 @@ import (
"evening_detective/internal/models"
"evening_detective/internal/services/story_service"
"evening_detective/proto"
"strings"
)
func mapTeamsToTeamAdvanced(team *models.Team) *proto.TeamAdvanced {
@@ -24,7 +25,7 @@ func mapTeamsToTeamFull(team *models.Team) *proto.TeamFull {
func mapProtoTeamsToTeam(team *proto.Team) *models.Team {
return &models.Team{
Name: team.Name,
Name: clearTeamName(team.Name),
}
}
@@ -85,3 +86,7 @@ func mapProtoApplicationToApplication(items *proto.Application) *models.Applicat
ID: items.Id,
}
}
func clearTeamName(code string) string {
return strings.TrimSpace(code)
}