From 5f946bb5058d4b7b2f5ef9b1b8530d7e065c8d01 Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Wed, 5 May 2021 11:48:46 -0400 Subject: [PATCH] Added assertion for the code editor. --- .../pipeline_editor/__jest__/processors/bytes.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx index 42d2885c6f656..9cfeb6b625ca4 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx @@ -88,6 +88,7 @@ describe('Processor: Bytes', () => { const { actions: { addProcessor, saveNewProcessor, addProcessorType }, form, + find, } = testBed; // This test ensures that the common fields that are used across all processors @@ -107,7 +108,8 @@ describe('Processor: Bytes', () => { form.setInputValue('tagField.input', 'some_tag'); // Trying to get the monaco text editor to work with CITs. - // form.setInputValue('ifField.textarea', "ctx?.network?.name == 'Guest'"); + const jsonContent = JSON.stringify({ content: "ctx?.network?.name == 'Guest'" }); + find('mockCodeEditor').simulate('change', { jsonContent }); // Save the field await saveNewProcessor(); @@ -116,7 +118,7 @@ describe('Processor: Bytes', () => { expect(processors[0].bytes).toEqual({ field: 'field_1', ignore_failure: true, - if: undefined, + if: jsonContent, tag: 'some_tag', ignore_missing: undefined, target_field: 'target_field',