mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 14:11:24 -03:30
add more VariablesDetail tests
This commit is contained in:
parent
49907e337a
commit
c6159a7c3e
@ -63,4 +63,20 @@ describe('<VariablesDetail>', () => {
|
||||
expect(input.prop('mode')).toEqual('javascript');
|
||||
expect(input.prop('value')).toEqual('{\n "bar": "baz"\n}');
|
||||
});
|
||||
|
||||
test('should default yaml value to "---"', () => {
|
||||
const wrapper = shallow(<VariablesDetail value="" label="Variables" />);
|
||||
const input = wrapper.find('Styled(CodeMirrorInput)');
|
||||
expect(input.prop('value')).toEqual('---');
|
||||
});
|
||||
|
||||
test('should default empty json to "{}"', () => {
|
||||
const wrapper = mount(<VariablesDetail value="" label="Variables" />);
|
||||
act(() => {
|
||||
wrapper.find('YamlJsonToggle').invoke('onChange')('javascript');
|
||||
});
|
||||
wrapper.setProps({ value: '' });
|
||||
const input = wrapper.find('Styled(CodeMirrorInput)');
|
||||
expect(input.prop('value')).toEqual('{}');
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user