diff --git a/backend/internal/core/currencies/currencies.go b/backend/internal/core/currencies/currencies.go index 505b6b1..b6a12c0 100644 --- a/backend/internal/core/currencies/currencies.go +++ b/backend/internal/core/currencies/currencies.go @@ -90,10 +90,10 @@ func (cs *CurrencyRegistry) Slice() []Currency { } func (cs *CurrencyRegistry) IsSupported(code string) bool { - lower := strings.ToLower(code) + upper := strings.ToUpper(code) cs.mu.RLock() defer cs.mu.RUnlock() - _, ok := cs.registry[lower] + _, ok := cs.registry[upper] return ok } diff --git a/backend/internal/core/services/main_test.go b/backend/internal/core/services/main_test.go index 57dce95..ecb07b0 100644 --- a/backend/internal/core/services/main_test.go +++ b/backend/internal/core/services/main_test.go @@ -6,6 +6,7 @@ import ( "os" "testing" + "github.com/hay-kot/homebox/backend/internal/core/currencies" "github.com/hay-kot/homebox/backend/internal/core/services/reporting/eventbus" "github.com/hay-kot/homebox/backend/internal/data/ent" "github.com/hay-kot/homebox/backend/internal/data/repo" @@ -61,7 +62,12 @@ func TestMain(m *testing.M) { tClient = client tRepos = repo.New(tClient, tbus, os.TempDir()+"/homebox") - tSvc = New(tRepos) + + defaults, _ := currencies.CollectionCurrencies( + currencies.CollectDefaults(), + ) + + tSvc = New(tRepos, WithCurrencies(defaults)) defer func() { _ = client.Close() }() bootstrap()