diff --git a/awx/ui_next/src/components/CodeEditor/CodeEditor.test.jsx b/awx/ui_next/src/components/CodeEditor/CodeEditor.test.jsx
index 2da3604574..be12a6d5ee 100644
--- a/awx/ui_next/src/components/CodeEditor/CodeEditor.test.jsx
+++ b/awx/ui_next/src/components/CodeEditor/CodeEditor.test.jsx
@@ -10,11 +10,12 @@ describe('CodeEditor', () => {
it('should trigger onChange prop', () => {
const onChange = jest.fn();
const wrapper = mount(
-
+
);
const aceEditor = wrapper.find('AceEditor');
expect(aceEditor.prop('mode')).toEqual('yaml');
expect(aceEditor.prop('setOptions').readOnly).toEqual(false);
+ expect(aceEditor.prop('value')).toEqual('---');
aceEditor.prop('onChange')('newvalue');
expect(onChange).toHaveBeenCalledWith('newvalue');
});
@@ -22,9 +23,10 @@ describe('CodeEditor', () => {
it('should render in read only mode', () => {
const onChange = jest.fn();
const wrapper = mount(
-
+
);
const aceEditor = wrapper.find('AceEditor');
expect(aceEditor.prop('setOptions').readOnly).toEqual(true);
+ expect(aceEditor.prop('value')).toEqual('---');
});
});
diff --git a/awx/ui_next/src/components/CodeEditor/VariablesField.test.jsx b/awx/ui_next/src/components/CodeEditor/VariablesField.test.jsx
index abbb091715..d1048ef4d1 100644
--- a/awx/ui_next/src/components/CodeEditor/VariablesField.test.jsx
+++ b/awx/ui_next/src/components/CodeEditor/VariablesField.test.jsx
@@ -40,6 +40,7 @@ describe('VariablesField', () => {
});
wrapper.update();
expect(wrapper.find('CodeEditor').prop('mode')).toEqual('javascript');
+ expect(wrapper.find('CodeEditor').prop('value')).toEqual('{}');
const buttons2 = wrapper.find('Button');
expect(buttons2.at(0).prop('variant')).toEqual('secondary');
expect(buttons2.at(1).prop('variant')).toEqual('primary');
@@ -69,6 +70,7 @@ describe('VariablesField', () => {
expect(field.prop('hasErrors')).toEqual(true);
expect(wrapper.find('.pf-m-error')).toHaveLength(1);
});
+
it('should render tooltip', () => {
const value = '---\n';
const wrapper = mountWithContexts(