From a63164bcf531131f10b3358ed21d98931db9e934 Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Tue, 21 Jan 2025 08:45:03 +0300 Subject: [PATCH] fix failing test --- dev/api_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dev/api_test.go b/dev/api_test.go index 2382bf0..ca00d96 100644 --- a/dev/api_test.go +++ b/dev/api_test.go @@ -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) @@ -16,10 +17,10 @@ func TestApiRequestAlias(t *testing.T) { t.Fatal(err) } addr := ra.PublicKey - + _, err = svc.RequestAlias(ctx, addr, "+254f00") if err == nil { - t.Fatalf("expected error") + t.Fatalf("expected error") } alias := "+254712345678" rb, err := svc.RequestAlias(ctx, addr, alias) @@ -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) }