This commit is contained in:
2026-10-19 02:33:10 +07:00
parent e96199afba
commit 6d69bedfbc
11 changed files with 123 additions and 32 deletions
+28
View File
@@ -0,0 +1,28 @@
package app
import (
"context"
"testing"
"evening_detective_server/internal/modules/processor_jwt"
"evening_detective_server/proto"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func TestSetScreenModeRejectsRemovedModes(t *testing.T) {
ctx := processor_jwt.ContextWithClaims(context.Background(), &processor_jwt.JWTClaims{
Roles: []string{"organizer"},
})
s := &server{}
for _, mode := range []int32{3, 5} {
_, err := s.SetScreenMode(ctx, &proto.SetScreenModeReq{
GameID: 1,
Mode: proto.ScreenMode(mode),
})
if status.Code(err) != codes.InvalidArgument {
t.Errorf("SetScreenMode(%d) = %v, want InvalidArgument", mode, err)
}
}
}