From 069d97e8dd19f25f088bcb642720062606e16e3d Mon Sep 17 00:00:00 2001 From: ras0q Date: Thu, 2 Nov 2023 16:59:43 +0900 Subject: [PATCH] :bug: use accountype the user doesn't have --- integration_tests/handler/user_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/integration_tests/handler/user_test.go b/integration_tests/handler/user_test.go index 28c2c470..257ac766 100644 --- a/integration_tests/handler/user_test.go +++ b/integration_tests/handler/user_test.go @@ -2,7 +2,6 @@ package handler import ( "encoding/json" - "math/rand" "net/http" "strings" "testing" @@ -659,12 +658,12 @@ func TestDeleteUserAccount(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() if tt.needInsertion { - accountType := domain.AccountType(rand.Intn(int(domain.AccountLimit))) + accountType := mockdata.AccountTypesMockUserDoesntHave(tt.userID)[0] reqBody := schema.AddUserAccountJSONRequestBody{ DisplayName: random.AlphaNumeric(), PrPermitted: schema.PrPermitted(random.Bool()), - Type: schema.AccountType(accountType), - Url: random.AccountURLString(accountType), + Type: accountType, + Url: random.AccountURLString(domain.AccountType(accountType)), } res := testutils.DoRequest(t, e, http.MethodPost, e.URL(api.User.AddUserAccount, tt.userID), &reqBody) testutils.AssertResponse(t, http.StatusCreated, schema.Account{