fix: add missing err checks and fix loop termination in tests
This commit is contained in:
@@ -134,6 +134,9 @@ func TestGetTodayAppointments_OmitsPreviousNameWhenNoHistory(t *testing.T) {
|
||||
VALUES ($1, NOW() + INTERVAL '5 minutes', 'in_progress')
|
||||
RETURNING id
|
||||
`, userID).Scan(&bookingID)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to insert test booking: %v", err)
|
||||
}
|
||||
addBookingService(t, ctx, tx, bookingID, svcID)
|
||||
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/admin/today/appointments", nil)
|
||||
@@ -344,6 +347,9 @@ func TestGetPendingApprovals_OmitsPreviousNameWhenNoHistory(t *testing.T) {
|
||||
VALUES ($1, NOW() + INTERVAL '1 day', 'pending')
|
||||
RETURNING id
|
||||
`, userID).Scan(&bookingID)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to insert test booking: %v", err)
|
||||
}
|
||||
addBookingService(t, ctx, tx, bookingID, svcID)
|
||||
|
||||
req := httptest.NewRequest(http.MethodGet, "/api/admin/today/pending-approvals", nil)
|
||||
|
||||
Reference in New Issue
Block a user