Skip to content

Commit

Permalink
mr improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kmigielek committed Jan 24, 2024
1 parent 50cdc99 commit d612aba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/invoice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"
"time"

"github.com/maxio-com/ab-golang-sdk/errors"
"github.com/maxio-com/ab-golang-sdk/models"
)

Expand Down Expand Up @@ -94,6 +95,7 @@ func (s *APISuite) TestInvoice() {

s.NoError(err)
s.Equal(http.StatusOK, events.Response.StatusCode)
s.Len(events.Data.Events, 1)
},
},
{
Expand Down Expand Up @@ -125,8 +127,12 @@ func (s *APISuite) TestInvoice() {
},
},
assert: func(t *testing.T, resp models.ApiResponse[models.InvoiceResponse], invoice models.CreateInvoice, err error) {
// s.Equal(err.Error(), errors.NewNestedErrorResponse(422, "Unprocessable Entity (WebDAV)").Error()) // not able to reat nested error messages here
s.Equal(err.Error(), errors.NewErrorArrayMapResponse(422, "Unprocessable Entity (WebDAV)").Error())
s.Equal(http.StatusUnprocessableEntity, resp.Response.StatusCode)

_, ok := err.(*errors.ErrorArrayMapResponse)
s.True(ok)
// cant check list of errors because map is nil
},
},
}
Expand Down

0 comments on commit d612aba

Please sign in to comment.