-
Notifications
You must be signed in to change notification settings - Fork 0
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
[APM] Update api tests to accomodate changes in API response #16
Conversation
@@ -6,7 +6,7 @@ | |||
*/ | |||
|
|||
import { FtrConfigProviderContext } from '@kbn/test/types/ftr'; | |||
import supertestAsPromised from 'supertest-as-promised'; | |||
import supertest from 'supertest'; |
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.
supertest-as-promised
is deprecated since 2016: WhoopInc/supertest-as-promised@ab56510
fyi: @spalger perhaps the dep should be removed from kibana entirely?
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.
It's planned elastic#95267
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.
Wow, what a coincidence that I notice that the day after Tyler created that issue :D Great!
); | ||
try { | ||
await createCustomLink(customLink); | ||
expect(true).to.be(false); |
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.
I don't?
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.
Thanks for the suggestions with expect.to.throwException
. It looks much better:
expect(async () => {
await createCustomLink(customLink);
}).to.throwException((e) => {
expect(e.res.status).to.be(403);
expectSnapshot(e.res.body.message).toMatchInline(
`"To create custom links, you must be subscribed to an Elastic Gold license or above. With it, you'll have the ability to create custom links to improve your workflow when analyzing your services."`
);
});
Unfortunately I couldn't make it work with promises. I'll merge this PR but will look into alternative options.
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.
This is very nice! Thank you.
* [Unified search] Create unified search plugin * add unified_search into USES_STYLED_COMPONENTS * fix JEST group 4 * update limits for data plugin * fix: remove unifiedSearch plugin from x-pack/plugins/file_upload * feat: updated .github/CODEOWNERS and set @elastic/kibana-app-services as a code owner * apply PR comments * [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' * feat: moved filter bar, apply filters folders and apply filter action from Data plugin to unified search plugin * fix Checks * fix Checks * fix Linting and Default CI Group #16 * fix Checks * fix Checks * fix Linting (with types) * fix show FILTER_BAR * fix Jest Tests * feat replece indexPatternsContranct in setIndexPatterns to DataViewsContract * feat: removed unnecessary interface in unified search * fix Checks * fix Checks * fix Jest Tests, Checks * fix Checks * resolve comments Co-authored-by: Alexey Antonov <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
elastic#167877) Revert of elastic#164574 Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Xavier Mouligneau <[email protected]>
This is required by: elastic#95146.
in elastic#95146 all APM api's were updated to return objects. This PR updates the API tests accordingly.
Additionally it adds a type safe client (
apmApiSupertest
) which is based on the same types as the api client in APM.cc @dgieselaar @smith @shahzad31