Skip to content

Commit

Permalink
Show index fails to clobber existing index
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Caldwell committed Mar 17, 2021
1 parent 739026a commit f0d06d8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion x-pack/test/api_integration/apis/maps/create_doc_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function ({ getService }) {
const supertest = getService('supertest');

describe('doc source creation', () => {
it('should create an index and pattern', async () => {
it('should create a new index and pattern but not clobber an existing one', async () => {
const resp = await supertest
.post(`/api/maps/docSource`)
.set('kbn-xsrf', 'kibana')
Expand All @@ -22,6 +22,16 @@ export default function ({ getService }) {
.expect(200);

expect(resp.body.success).to.be(true);

// Repeated index fails. We don't want the user clobbering indexes
await supertest
.post(`/api/maps/docSource`)
.set('kbn-xsrf', 'kibana')
.send({
index: 'testing123',
mappings: { properties: { coordinates: { type: 'geo_point' } } },
})
.expect(500);
});

it('should fail to create index and pattern with invalid index', async () => {
Expand Down

0 comments on commit f0d06d8

Please sign in to comment.