-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Cases] Decode responses from the user actions service #157971
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
doc, | ||
this.context.persistableStateAttachmentTypeRegistry | ||
); | ||
|
||
const decodeRes = decodeOrThrow(UserActionTransformedAttributesRt)(res.attributes); | ||
|
||
const fieldsDoc = { |
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.
nit: Should we start doing Object.assign
?
@@ -1578,6 +1587,383 @@ describe('CaseUserActionService', () => { | |||
] | |||
`); | |||
}); | |||
|
|||
describe('Decode', () => { |
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.
In my opinion this seems like a lot of work to test the transform and decode logic. If you'd like to keep them that's fine. I feel like it'd be more straightforward and readable if we test the functionality directly rather than going through these top level functions 🤷♂️. I can see the benefit of exercising the whole flow but it seems like we have to mock a whole lot just to get to that point.
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.
We talked about it offline and we decide to leave the tests as it is.
}; | ||
|
||
const mockPointInTimeFinder = (soFindRes: SavedObjectsFindResponse) => { | ||
// console.log(soFindRes); |
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.
Let's remove the comment.
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @cnasikas |
## Summary This PR decodes the response returned by the user actions service. Depends on: elastic#157858, elastic#156622 ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR decodes the response returned by the user actions service.
Depends on: #157858, #156622
Checklist
Delete any items that are not applicable to this PR.
For maintainers