Skip to content

Commit

Permalink
add api integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed May 11, 2020
1 parent 9180c7c commit 82b5a81
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ export default function({ getService }: FtrProviderContext) {
describe('Pipelines', function() {
describe('Create', () => {
const PIPELINE_ID = 'test_create_pipeline';
after(() => deletePipeline(PIPELINE_ID));
const REQUIRED_FIELDS_PIPELINE_ID = 'test_create_required_fields_pipeline';

after(() => {
deletePipeline(PIPELINE_ID);
deletePipeline(REQUIRED_FIELDS_PIPELINE_ID);
});

it('should create a pipeline', async () => {
const { body } = await supertest
Expand Down Expand Up @@ -52,6 +57,28 @@ export default function({ getService }: FtrProviderContext) {
});
});

it('should create a pipeline with only required fields', async () => {
const { body } = await supertest
.post(API_BASE_PATH)
.set('kbn-xsrf', 'xxx')
// Excludes description, version and on_failure processors
.send({
name: REQUIRED_FIELDS_PIPELINE_ID,
processors: [
{
script: {
source: 'ctx._type = null',
},
},
],
})
.expect(200);

expect(body).to.eql({
acknowledged: true,
});
});

it('should not allow creation of an existing pipeline', async () => {
const { body } = await supertest
.post(API_BASE_PATH)
Expand Down

0 comments on commit 82b5a81

Please sign in to comment.