fix: add 60% coverage minimum to CI, scope prettier to staged frontend files
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user