Skip to content

Commit

Permalink
Added assertion for the code editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Dorlus committed May 5, 2021
1 parent b19fdce commit 5f946bb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand All @@ -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',
Expand Down

0 comments on commit 5f946bb

Please sign in to comment.