fix failing test

This commit is contained in:
Carlosokumu 2025-01-21 08:45:03 +03:00
parent fa355e3729
commit a63164bcf5
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953

View File

@ -9,6 +9,7 @@ import (
func TestApiRequestAlias(t *testing.T) {
ctx := context.Background()
ctx = context.WithValue(ctx, "SessionId", "+25471234565")
storageService := mocks.NewMemStorageService(ctx)
svc := NewDevAccountService(ctx, storageService)
ra, err := svc.CreateAccount(ctx)
@ -39,6 +40,7 @@ func TestApiRequestAlias(t *testing.T) {
if err != nil {
t.Fatal(err)
}
alias = "foo.sarafu.local"
if rb.Alias != alias {
t.Fatalf("expected '%s', got '%s'", alias, rb.Alias)
}
@ -56,12 +58,12 @@ func TestApiRequestAlias(t *testing.T) {
t.Fatal(err)
}
addr = ra.PublicKey
alias = "foox"
rb, err = svc.RequestAlias(ctx, addr, alias)
if err != nil {
t.Fatal(err)
}
alias = "foox"
alias = "foox.sarafu.local"
if rb.Alias != alias {
t.Fatalf("expected '%s', got '%s'", alias, rb.Alias)
}