fix: add 60% coverage minimum to CI, scope prettier to staged frontend files

This commit is contained in:
2026-07-11 17:09:37 +01:00
parent 7d6cb0c375
commit 0afa642a10
4 changed files with 22 additions and 16 deletions
+1 -1
View File
@@ -1086,7 +1086,7 @@ func BuyGiftCard(w http.ResponseWriter, r *http.Request) {
recipient = userEmail
}
// Notify admin about the friend gift card (email delivery not yet implemented — admin must send manually)
if _, err := tx.Exec(ctx, `
if _, err := db.Conn.Exec(context.Background(), `
INSERT INTO admin_notifications (reason, booking_id, user_id)
VALUES ('gift_card_purchased_for_friend', NULL, $1)
`, userID); err != nil {
+4 -10
View File
@@ -20,6 +20,7 @@ import (
"github.com/go-chi/chi/v5"
"github.com/jackc/pgx/v5"
"github.com/stretchr/testify/require"
)
func TestCreateTillSale_OnTheHouse(t *testing.T) {
@@ -541,17 +542,10 @@ func TestGetTillCheckoutStatus_Completed(t *testing.T) {
}
// Wait for the mock goroutine to complete the checkout with polling.
deadline := time.Now().Add(5 * time.Second)
for {
require.Eventually(t, func() bool {
_, err := SquareClient.GetCheckout(context.Background(), *createResp.CheckoutID)
if err == nil {
break
}
if time.Now().After(deadline) {
t.Fatalf("timed out waiting for checkout to complete: %v", err)
}
time.Sleep(100 * time.Millisecond)
}
return err == nil
}, 5*time.Second, 100*time.Millisecond)
// Now call GetTillCheckoutStatus — should return COMPLETED.
statusReq := httptest.NewRequest("GET", "/api/admin/till/checkout/"+*createResp.CheckoutID+"/status", nil)