-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIRST-19] Test Case(s) for Invoices #5
Conversation
bf2f78f
to
75f5fb3
Compare
test/invoice_test.go
Outdated
}, | ||
}, | ||
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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to get any information from NestedErrorResponse
?
type NestedErrorResponse struct {
apiError.ApiError
Errors map[string]interface{} `json:"errors,omitempty"`
}
5eb3788
to
fdd64d3
Compare
155ff94
to
e0cc84f
Compare
e0cc84f
to
50cdc99
Compare
) | ||
|
||
s.NoError(err) | ||
s.Equal(http.StatusOK, events.Response.StatusCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add one small assertion that the response list is not empty? Just to check sdk deserializes it
test/invoice_test.go
Outdated
}, | ||
}, | ||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it's going to be ErrorArrayMapResponseException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
0534649
to
8b53602
Compare
8b53602
to
f627e00
Compare
No description provided.