From b4436a84aca0242d820ca057f021b4808b590277 Mon Sep 17 00:00:00 2001 From: Sonia Sanz Vivas Date: Tue, 26 Nov 2024 16:23:27 +0100 Subject: [PATCH] Add illegal characters to xjson processors test --- .../__jest__/processors/foreach.test.tsx | 5 +++-- .../pipeline_editor/__jest__/processors/grok.test.ts | 5 +++-- .../__jest__/processors/inference.test.tsx | 10 ++++++---- .../__jest__/processors/redact.test.tsx | 5 +++-- .../__jest__/processors/script.test.tsx | 5 +++-- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/foreach.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/foreach.test.tsx index 1cbcbb0eb1382..e4ca33fbffadb 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/foreach.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/foreach.test.tsx @@ -95,7 +95,7 @@ describe('Processor: Foreach', () => { await act(async () => { find('processorField').simulate('change', { - jsonContent: '{"def_1":"""aaa(bbb""", "def_2":"aaa(bbb"}', + jsonContent: '{"def_1":"""aaa"bbb""", "def_2":"aaa(bbb"}', }); // advance timers to allow the form to validate @@ -110,7 +110,8 @@ describe('Processor: Foreach', () => { expect(processors[0][FOREACH_TYPE]).toEqual({ field: 'test_foreach_processor', - processor: { def_1: 'aaa(bbb', def_2: 'aaa(bbb' }, + // eslint-disable-next-line prettier/prettier + processor: { def_1: 'aaa\"bbb', def_2: 'aaa(bbb' }, }); }); }); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts index 32f37f4e254e4..84e4948495695 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts @@ -143,7 +143,7 @@ describe('Processor: Grok', () => { await act(async () => { find('patternDefinitionsField').simulate('change', { - jsonContent: '{"pattern_1":"""aaa(bbb""", "pattern_2":"aaa(bbb"}', + jsonContent: '{"pattern_1":"""aaa"bbb""", "pattern_2":"aaa(bbb"}', }); // advance timers to allow the form to validate @@ -159,7 +159,8 @@ describe('Processor: Grok', () => { expect(processors[0][GROK_TYPE]).toEqual({ field: 'test_grok_processor', patterns: ['pattern1'], - pattern_definitions: { pattern_1: 'aaa(bbb', pattern_2: 'aaa(bbb' }, + // eslint-disable-next-line prettier/prettier + pattern_definitions: { pattern_1: 'aaa\"bbb', pattern_2: 'aaa(bbb' }, }); }); }); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/inference.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/inference.test.tsx index 1f763219e43fb..5a07fc63d087b 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/inference.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/inference.test.tsx @@ -77,7 +77,7 @@ describe('Processor: Script', () => { await act(async () => { find('inferenceConfig').simulate('change', { - jsonContent: '{"inf_conf_1":"""aaa(bbb""", "inf_conf_2": "aaa(bbb"}', + jsonContent: '{"inf_conf_1":"""aaa"bbb""", "inf_conf_2": "aaa(bbb"}', }); // advance timers to allow the form to validate @@ -87,7 +87,7 @@ describe('Processor: Script', () => { await act(async () => { find('fieldMap').simulate('change', { - jsonContent: '{"field_map_1":"""aaa(bbb""", "field_map_2": "aaa(bbb"}', + jsonContent: '{"field_map_1":"""aaa"bbb""", "field_map_2": "aaa(bbb"}', }); // advance timers to allow the form to validate @@ -102,8 +102,10 @@ describe('Processor: Script', () => { expect(processors[0][INFERENCE_TYPE]).toEqual({ model_id: 'test_inference_processor', - inference_config: { inf_conf_1: 'aaa(bbb', inf_conf_2: 'aaa(bbb' }, - field_map: { field_map_1: 'aaa(bbb', field_map_2: 'aaa(bbb' }, + // eslint-disable-next-line prettier/prettier + inference_config: { inf_conf_1: 'aaa\"bbb', inf_conf_2: 'aaa(bbb' }, + // eslint-disable-next-line prettier/prettier + field_map: { field_map_1: 'aaa\"bbb', field_map_2: 'aaa(bbb' }, }); }); }); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/redact.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/redact.test.tsx index 5c52511867e84..eda4bac8266dd 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/redact.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/redact.test.tsx @@ -154,7 +154,7 @@ describe('Processor: Redact', () => { await act(async () => { find('patternDefinitionsField').simulate('change', { - jsonContent: '{"pattern_1":"""aaa(bbb""", "pattern_2":"aaa(bbb"}', + jsonContent: '{"pattern_1":"""aaa"bbb""", "pattern_2":"aaa(bbb"}', }); // advance timers to allow the form to validate @@ -170,7 +170,8 @@ describe('Processor: Redact', () => { expect(processors[0][REDACT_TYPE]).toEqual({ field: 'test_redact_processor', patterns: ['pattern1'], - pattern_definitions: { pattern_1: 'aaa(bbb', pattern_2: 'aaa(bbb' }, + + pattern_definitions: { pattern_1: 'aaa"bbb', pattern_2: 'aaa(bbb' }, }); }); }); diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/script.test.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/script.test.tsx index c6bcc9afe5f26..428c87ea6a7e7 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/script.test.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/script.test.tsx @@ -82,7 +82,7 @@ describe('Processor: Script', () => { await act(async () => { find('paramsField').simulate('change', { - jsonContent: '{"sum_field":"""aaa(bbb"""}', + jsonContent: '{"sum_field":"""aaa"bbb"""}', }); // advance timers to allow the form to validate @@ -97,7 +97,8 @@ describe('Processor: Script', () => { expect(processors[0][SCRIPT_TYPE]).toEqual({ source: 'ctx._source[params.sum_field]', - params: { sum_field: 'aaa(bbb' }, + // eslint-disable-next-line prettier/prettier + params: { sum_field: 'aaa\"bbb' }, }); }); });