chore: build
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user