| 1 | package doctor |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | "testing" |
| 6 | |
| 7 | "reasonix/internal/config" |
| 8 | ) |
| 9 | |
| 10 | func TestCollectBillingIncludesProvidersAndDisplay(t *testing.T) { |
| 11 | cfg := config.Default() |
| 12 | cfg.Billing.DisplayCurrency = "CNY" |
| 13 | rep := CollectBilling(cfg) |
| 14 | if rep.DisplayCurrency != "CNY" { |
| 15 | t.Fatalf("display = %q", rep.DisplayCurrency) |
| 16 | } |
| 17 | if len(rep.Providers) == 0 { |
| 18 | t.Fatal("expected providers") |
| 19 | } |
| 20 | text := RenderBillingText(rep) |
| 21 | for _, want := range []string{"display preference", "display resolved", "providers:", "fx enabled: false", "Runtime FX is disabled"} { |
| 22 | if !strings.Contains(text, want) { |
| 23 | t.Fatalf("render missing %q:\n%s", want, text) |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 |