完善本地质量门禁与资金链路测试

This commit is contained in:
yml2213
2026-09-02 13:50:19 +08:00
parent dd2b45bd2c
commit 208f12ddb4
80 changed files with 12245 additions and 11541 deletions
+12 -2
View File
@@ -170,13 +170,19 @@ func TestArbitrationReleaseDepositDoesNotRepublishListing(t *testing.T) {
t.Fatalf("读取仲裁后订单模型失败: %v", err)
}
assertEqual(t, "仲裁退款状态", orderRow.RefundStatus, "refunded")
assertEqual(t, "仲裁退款金额", orderRow.RefundAmountCent, int64(15000))
assertEqual(t, "仲裁退款金额", orderRow.RefundAmountCent, int64(25800))
walletAccount, err := services.wallet.Account(t.Context(), owner.ID)
if err != nil {
t.Fatalf("读取号主钱包失败: %v", err)
}
assertEqual(t, "仲裁后号主可用余额", walletAccount.AvailableBalanceCent, int64(35300))
assertEqual(t, "仲裁后号主可用余额", walletAccount.AvailableBalanceCent, int64(24500))
assertEqual(
t,
"仲裁资金守恒",
orderRow.RefundAmountCent+walletAccount.AvailableBalanceCent+3000,
orderRow.RentAmountCent+orderRow.DepositAmountCent,
)
var listingRow model.RentalListing
if err := db.First(&listingRow, approved.ID).Error; err != nil {
@@ -432,6 +438,10 @@ func createListingUnderReview(t *testing.T, service *listing.Service, ownerID ui
ScreenshotURLS: []string{"https://example.com/e2e-account.png"},
AssetSummary: map[string]any{
"fire_level": 50,
"online_time": map[string]any{
"start": "09:00",
"end": "23:00",
},
"price_breakdown": map[string]any{
"seller_coin_base_price": 233,
"seller_total_price": 353,