Skip to content
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

Merged
merged 2 commits into from
Jan 24, 2024
Merged

Conversation

kazimierzm-iRonin
Copy link
Contributor

No description provided.

},
},
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())
Copy link
Contributor

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"`
}

)

s.NoError(err)
s.Equal(http.StatusOK, events.Response.StatusCode)
Copy link
Contributor

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

},
},
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
Copy link
Contributor

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

Copy link
Contributor

@maciej-nedza maciej-nedza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kazimierzm-iRonin kazimierzm-iRonin force-pushed the FIRST-20 branch 2 times, most recently from 0534649 to 8b53602 Compare January 24, 2024 11:44
@kazimierzm-iRonin kazimierzm-iRonin merged commit 513a9ee into FIRST-9 Jan 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants