From 4332a1537bc235eb275e24d2984d2bedec7e556a Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Tue, 5 Apr 2022 16:25:34 +0000 Subject: [PATCH] Remove invalid test --- server/account_test.go | 20 +------------------- server/main_test.go | 6 ++---- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/server/account_test.go b/server/account_test.go index b9f6750..591dc46 100644 --- a/server/account_test.go +++ b/server/account_test.go @@ -19,7 +19,7 @@ func init() { //nolint:gochecknoinits txdb.Register("pgtx", "pgx", "postgres://budgeteer:budgeteer@db:5432/budgeteer_test") } -func TestRegisterUser(t *testing.T) { //nolint:funlen +func TestRegisterUser(t *testing.T) { t.Parallel() database, err := postgres.Connect("pgtx", "example") if err != nil { @@ -66,22 +66,4 @@ func TestRegisterUser(t *testing.T) { //nolint:funlen t.Error("Did not get a token") } }) - - t.Run("GetTransactions", func(t *testing.T) { - t.Parallel() - context.Request, err = http.NewRequest(http.MethodGet, "/account/accountid/transactions", nil) - if recorder.Code != http.StatusOK { - t.Errorf("handler returned wrong status code: got %v want %v", recorder.Code, http.StatusOK) - } - - var response TransactionsResponse - err = json.NewDecoder(recorder.Body).Decode(&response) - if err != nil { - t.Error(err.Error()) - t.Error("Error retreiving list of transactions.") - } - if len(response.Transactions) == 0 { - t.Error("Did not get any transactions.") - } - }) } diff --git a/server/main_test.go b/server/main_test.go index 10f3505..114e73c 100644 --- a/server/main_test.go +++ b/server/main_test.go @@ -83,14 +83,12 @@ func (h Handler) CheckAvailableBalance(ctx context.Context, t *testing.T, budget firstOfNextMonth := time.Date(2022, 2, 1, 0, 0, 0, 0, loc) data, err := h.prepareBudgeting(ctx, *budget, firstOfNextMonth, first) if err != nil { - fmt.Println(err) - t.Fail() + t.Errorf("prepare budgeting: %s", err) return } if data.AvailableBalance.GetFloat64() != -115170.56 { - fmt.Println("Available balance is wrong:") - t.Fail() + t.Errorf("available balance is wrong") return } }