mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
add VariablesField expand test
This commit is contained in:
parent
f867c9e476
commit
659f68f280
@ -136,4 +136,27 @@ describe('VariablesField', () => {
|
||||
|
||||
expect(wrapper.find('CodeEditor').prop('mode')).toEqual('javascript');
|
||||
});
|
||||
|
||||
it('should open modal when expanded', async () => {
|
||||
const value = '---';
|
||||
const wrapper = mountWithContexts(
|
||||
<Formik initialValues={{ variables: value }} onSubmit={jest.fn()}>
|
||||
{formik => (
|
||||
<form onSubmit={formik.handleSubmit}>
|
||||
<VariablesField id="the-field" name="variables" label="Variables" />
|
||||
<button type="submit" id="submit">
|
||||
Submit
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
</Formik>
|
||||
);
|
||||
expect(wrapper.find('Modal').prop('isOpen')).toEqual(false);
|
||||
|
||||
wrapper.find('Button[variant="plain"]').invoke('onClick')();
|
||||
wrapper.update();
|
||||
|
||||
expect(wrapper.find('Modal').prop('isOpen')).toEqual(true);
|
||||
expect(wrapper.find('Modal CodeEditor')).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user