mirror of
https://github.com/elastic/kibana.git
synced 2025-06-29 03:24:45 -04:00
Fixes https://github.com/elastic/kibana/issues/157104 and https://github.com/elastic/kibana/issues/156323 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
* 2.0.
|
|
*/
|
|
|
|
import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common';
|
|
|
|
export default function ({ getService }) {
|
|
const supertest = getService('supertest');
|
|
|
|
describe('doc feature deletion', () => {
|
|
it('should delete a valid feature document', async () => {
|
|
await supertest
|
|
.delete(`/internal/maps/feature/999`)
|
|
.set('kbn-xsrf', 'kibana')
|
|
.set(ELASTIC_HTTP_VERSION_HEADER, '1')
|
|
.send({
|
|
index: 'drawing_data',
|
|
})
|
|
.expect(200);
|
|
});
|
|
|
|
it('previously deleted document no longer exists in index', async () => {
|
|
await supertest
|
|
.delete(`/internal/maps/feature/999`)
|
|
.set('kbn-xsrf', 'kibana')
|
|
.set(ELASTIC_HTTP_VERSION_HEADER, '1')
|
|
.send({
|
|
index: 'drawing_data',
|
|
})
|
|
.expect(404);
|
|
});
|
|
|
|
it('should fail if not a valid document', async () => {
|
|
await supertest
|
|
.delete(`/internal/maps/feature/998`)
|
|
.set('kbn-xsrf', 'kibana')
|
|
.set(ELASTIC_HTTP_VERSION_HEADER, '1')
|
|
.send({
|
|
index: 'drawing_data',
|
|
})
|
|
.expect(404);
|
|
});
|
|
});
|
|
}
|