Skip to content

Commit

Permalink
fix: failed test due to changed spender id type
Browse files Browse the repository at this point in the history
  • Loading branch information
Earth Varis committed May 19, 2024
1 parent eace3d6 commit ccd0333
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/expenses/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestGetAllExpense(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, http.StatusOK, rec.Code)
assert.JSONEq(t, `[
{"amount":1000, "category":"food", "date":"2024-05-18T00:00:00Z", "id":1, "image_url":"image_url", "note":"note", "spender_id":"1", "transaction_type":"expense"}
{"amount":1000, "category":"food", "date":"2024-05-18T00:00:00Z", "id":1, "image_url":"image_url", "note":"note", "spender_id":1, "transaction_type":"expense"}
]`, rec.Body.String())
})
t.Run("get expenses with amount query params should call query with amount arg", func(t *testing.T) {
Expand Down Expand Up @@ -171,7 +171,7 @@ func TestGetAllExpense(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, http.StatusOK, rec.Code)
assert.JSONEq(t, `[
{"amount":1000, "category":"food", "date":"2024-05-18T00:00:00Z", "id":1, "image_url":"image_url", "note":"note", "spender_id":"1", "transaction_type":"expense"}
{"amount":1000, "category":"food", "date":"2024-05-18T00:00:00Z", "id":1, "image_url":"image_url", "note":"note", "spender_id":1, "transaction_type":"expense"}
]`, rec.Body.String())
})
t.Run("get expenses with category query params should call query with category arg", func(t *testing.T) {
Expand Down Expand Up @@ -201,7 +201,7 @@ func TestGetAllExpense(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, http.StatusOK, rec.Code)
assert.JSONEq(t, `[
{"amount":1000, "category":"food", "date":"2024-05-18T00:00:00Z", "id":1, "image_url":"image_url", "note":"note", "spender_id":"1", "transaction_type":"expense"}
{"amount":1000, "category":"food", "date":"2024-05-18T00:00:00Z", "id":1, "image_url":"image_url", "note":"note", "spender_id":1, "transaction_type":"expense"}
]`, rec.Body.String())
})

Expand Down

0 comments on commit ccd0333

Please sign in to comment.