chore: build
Backend - Build & Lint / build (push) Failing after 29m5s
Frontend Client - EAS Build / build (push) Failing after 2h25m33s

This commit is contained in:
Nuxgrid
2026-07-14 18:34:58 +02:00
parent 8c3fa39d86
commit 734493363f
17 changed files with 2014 additions and 7 deletions
@@ -204,6 +204,33 @@ func TestDeleteCommandAtomic_DoesNotRefundAlreadyCancelledOrApprovedOrder(t *tes
}
}
// Régression: une commande "livrée" (marchandise déjà sortie du stock au
// checkout, remise au client) ne doit pas voir son stock remboursé lors
// d'une suppression — symétrique à CancelCommandByAdminAtomic qui exclut
// déjà "livre" de son remboursement.
func TestDeleteCommandAtomic_DoesNotRefundDeliveredOrder(t *testing.T) {
cleanupStockTestData(t)
username := newTestClient(t, "delete_admin_livre")
productID := newTestProduct(t, "DeleteAdminLivre", 5)
cmdID := newTestCommandWithItem(t, username, "livre", "", productID, 4, 40)
if err := testDB.DeleteCommandAtomic(cmdID, "admin_test", "admin"); err != nil {
t.Fatalf("DeleteCommandAtomic: %v", err)
}
if got := productStock(t, productID); got != 5 {
t.Errorf("stock ne doit pas être remboursé pour une commande déjà livrée: got=%.2f want=5", got)
}
}
func TestDeleteCommandAtomic_UnknownCommandReturnsError(t *testing.T) {
cleanupStockTestData(t)
err := testDB.DeleteCommandAtomic(99999999, "admin_test", "admin")
if err == nil {
t.Fatal("DeleteCommandAtomic sur une commande inexistante doit retourner une erreur")
}
}
// ── Crypto (CancelCryptoCommand) ────────────────────────────────────────────
func TestCancelCryptoCommand_RefundsStockOnPendingPayment(t *testing.T) {