Skip to content

Commit

Permalink
Add illegal characters to xjson processors test
Browse files Browse the repository at this point in the history
  • Loading branch information
SoniaSanzV committed Nov 26, 2024
1 parent a673f9a commit b4436a8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' },
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' },
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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' },
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' },
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' },
});
});
});

0 comments on commit b4436a8

Please sign in to comment.