Skip to content

Commit

Permalink
Merge pull request #597 from traPtitech/fix/test-delete-user-account
Browse files Browse the repository at this point in the history
  • Loading branch information
ras0q authored Nov 2, 2023
2 parents 2e65ce6 + 069d97e commit 9cd47a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions integration_tests/handler/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package handler

import (
"encoding/json"
"math/rand"
"net/http"
"strings"
"testing"
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 9cd47a9

Please sign in to comment.