package config

import "testing"

func TestTierForPriceID(t *testing.T) {
	t.Parallel()

	cfg := &Config{
		StripePriceIDPremium: "price_premium_123",
		StripePriceIDPro:     "price_pro_456",
	}

	tests := []struct {
		priceID string
		want    string
	}{
		{"price_premium_123", "premium"},
		{"price_pro_456", "pro"},
		{"price_unknown", ""},
		{"", ""},
	}

	for _, tt := range tests {
		if got := cfg.TierForPriceID(tt.priceID); got != tt.want {
			t.Errorf("TierForPriceID(%q) = %q, want %q", tt.priceID, got, tt.want)
		}
	}
}
