diff --git a/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.test.jsx b/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.test.jsx index b99fda9f16..05548f8aa8 100644 --- a/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.test.jsx +++ b/awx/ui_next/src/components/CodeMirrorInput/VariablesDetail.test.jsx @@ -63,4 +63,20 @@ describe('', () => { expect(input.prop('mode')).toEqual('javascript'); expect(input.prop('value')).toEqual('{\n "bar": "baz"\n}'); }); + + test('should default yaml value to "---"', () => { + const wrapper = shallow(); + const input = wrapper.find('Styled(CodeMirrorInput)'); + expect(input.prop('value')).toEqual('---'); + }); + + test('should default empty json to "{}"', () => { + const wrapper = mount(); + act(() => { + wrapper.find('YamlJsonToggle').invoke('onChange')('javascript'); + }); + wrapper.setProps({ value: '' }); + const input = wrapper.find('Styled(CodeMirrorInput)'); + expect(input.prop('value')).toEqual('{}'); + }); });