aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/admin/handler_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/admin/handler_test.go')
-rw-r--r--backend/admin/handler_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/admin/handler_test.go b/backend/admin/handler_test.go
index 994c584..f340fef 100644
--- a/backend/admin/handler_test.go
+++ b/backend/admin/handler_test.go
@@ -1182,6 +1182,11 @@ func TestGetSubmissions_Success(t *testing.T) {
},
}, nil
},
+ listUsersFunc: func(_ context.Context) ([]db.User, error) {
+ return []db.User{
+ {UserID: 1, Username: "alice"},
+ }, nil
+ },
}
h := newTestHandler(q)
@@ -1208,6 +1213,9 @@ func TestGetSubmissionDetail_Success(t *testing.T) {
CreatedAt: pgtype.Timestamp{Valid: true},
}, nil
},
+ getUserByIDFunc: func(_ context.Context, userID int32) (db.User, error) {
+ return db.User{UserID: userID, Username: "alice"}, nil
+ },
getTestcaseResultsBySubmIDFunc: func(_ context.Context, _ int32) ([]db.TestcaseResult, error) {
return []db.TestcaseResult{
{