[APM] fixing annotations unit test (#138302)

This commit is contained in:
Cauê Marcondes 2022-08-09 09:06:12 -04:00 committed by GitHub
parent 1031fb56f3
commit ab937a3716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,8 +16,7 @@ import * as GetStoredAnnotations from './get_stored_annotations';
import { Annotation, AnnotationType } from '../../../../common/annotations';
import { errors } from '@elastic/elasticsearch';
// FLAKY: https://github.com/elastic/kibana/issues/138039
describe.skip('getServiceAnnotations', () => {
describe('getServiceAnnotations', () => {
const storedAnnotations = [
{
type: AnnotationType.VERSION,
@ -218,21 +217,17 @@ describe.skip('getServiceAnnotations', () => {
.mockImplementation(
() =>
new Promise((resolve, reject) => {
setTimeout(() => {
reject(
new WrappedElasticsearchClientError(
new errors.RequestAbortedError('foo')
)
);
}, 20);
reject(
new WrappedElasticsearchClientError(
new errors.RequestAbortedError('foo')
)
);
})
);
jest.spyOn(GetStoredAnnotations, 'getStoredAnnotations').mockImplementation(
async () =>
new Promise((resolve) => {
setTimeout(() => {
resolve(storedAnnotations);
}, 10);
resolve(storedAnnotations);
})
);