(t *testing.T)
| 10208 | } |
| 10209 | |
| 10210 | func TestChatCostSummary_AfterModelDeletion(t *testing.T) { |
| 10211 | t.Parallel() |
| 10212 | |
| 10213 | f := seedChatCostFixture(t) |
| 10214 | ctx := testutil.Context(t, testutil.WaitLong) |
| 10215 | options := f.safeOptions() |
| 10216 | |
| 10217 | // Baseline: use DB-derived timestamps to avoid time boundary flakes. |
| 10218 | summary, err := f.Client.GetChatCostSummary(ctx, "me", options) |
| 10219 | require.NoError(t, err) |
| 10220 | assertChatCostSummary(t, summary, f.ModelConfigID, f.ChatID) |
| 10221 | |
| 10222 | // Soft-delete the model config. |
| 10223 | err = f.Client.DeleteChatModelConfig(ctx, f.ModelConfigID) |
| 10224 | require.NoError(t, err) |
| 10225 | |
| 10226 | // Costs must survive the deletion unchanged within the same safe window. |
| 10227 | summary, err = f.Client.GetChatCostSummary(ctx, "me", options) |
| 10228 | require.NoError(t, err) |
| 10229 | assertChatCostSummary(t, summary, f.ModelConfigID, f.ChatID) |
| 10230 | } |
| 10231 | |
| 10232 | func TestChatCostSummary_AdminDrilldown(t *testing.T) { |
| 10233 | t.Parallel() |
nothing calls this directly
no test coverage detected