From a0eaf12a01fa94cc9b67c081f368cb369caec511 Mon Sep 17 00:00:00 2001 From: xueshiji Date: Wed, 1 Jul 2026 17:54:39 +0800 Subject: [PATCH] fix: test --- backend/internal/service/billing_service_test.go | 4 ++-- backend/internal/service/billing_service_unified_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/internal/service/billing_service_test.go b/backend/internal/service/billing_service_test.go index 88debae99a..92c143c6ff 100644 --- a/backend/internal/service/billing_service_test.go +++ b/backend/internal/service/billing_service_test.go @@ -1377,7 +1377,7 @@ func TestComputeTokenBreakdown_ExplicitZeroImagePrice_NoFallback(t *testing.T) { OutputTokens: 200, ImageOutputTokens: 50, } - bd := svc.computeTokenBreakdown(pricing, tokens, 1.0, 0, false, "", false) + bd := svc.computeTokenBreakdown(pricing, tokens, 1.0, "", false) // ImageOutputTokens should NOT fall back to outputPrice require.Equal(t, 0.0, bd.ImageOutputCost) @@ -1399,7 +1399,7 @@ func TestComputeTokenBreakdown_NonExplicitZeroImagePrice_FallsBackToOutput(t *te OutputTokens: 200, ImageOutputTokens: 50, } - bd := svc.computeTokenBreakdown(pricing, tokens, 1.0, 0, false, "", false) + bd := svc.computeTokenBreakdown(pricing, tokens, 1.0, "", false) // Should fall back to outputPrice since not explicit require.InDelta(t, 50*15e-6, bd.ImageOutputCost, 1e-12) diff --git a/backend/internal/service/billing_service_unified_test.go b/backend/internal/service/billing_service_unified_test.go index db7437d6ba..eabbab3dfc 100644 --- a/backend/internal/service/billing_service_unified_test.go +++ b/backend/internal/service/billing_service_unified_test.go @@ -29,7 +29,7 @@ func TestCalculateCostUnified_NilResolver_FallsBackToOldPath(t *testing.T) { require.NoError(t, err) // Should match the old-path result exactly - expected, err := svc.calculateCostInternal("claude-sonnet-4", tokens, 1.0, 0, false, "", nil) + expected, err := svc.calculateCostInternal("claude-sonnet-4", tokens, 1.0, "", nil) require.NoError(t, err) require.InDelta(t, expected.TotalCost, cost.TotalCost, 1e-10) require.InDelta(t, expected.ActualCost, cost.ActualCost, 1e-10)