mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
add tests ensuring forms pass correct value to CodeEditor fields
This commit is contained in:
parent
4e55c98bc6
commit
6b2cee2f69
@ -74,6 +74,10 @@ describe('<SmartInventoryEdit />', () => {
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
test('should render CodeEditor field', () => {
|
||||
expect(wrapper.find('CodeEditor').prop('value')).toEqual('---');
|
||||
});
|
||||
|
||||
test('should fetch related instance groups on initial render', async () => {
|
||||
expect(InventoriesAPI.readInstanceGroups).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
@ -94,6 +94,7 @@ describe('<InventoryForm />', () => {
|
||||
1
|
||||
);
|
||||
expect(wrapper.find('VariablesField[label="Variables"]').length).toBe(1);
|
||||
expect(wrapper.find('CodeEditor').prop('value')).toEqual('---');
|
||||
});
|
||||
|
||||
test('should update form values', async () => {
|
||||
|
||||
@ -79,6 +79,33 @@ describe('<NotificationTemplateForm />', () => {
|
||||
).toEqual(defaultMessages);
|
||||
});
|
||||
|
||||
test('should render custom messages fields', () => {
|
||||
const wrapper = mountWithContexts(
|
||||
<NotificationTemplateForm
|
||||
template={{
|
||||
...template,
|
||||
messages: {
|
||||
started: {
|
||||
message: 'Started',
|
||||
body: null,
|
||||
},
|
||||
},
|
||||
}}
|
||||
defaultMessages={defaultMessages}
|
||||
detailUrl="/notification_templates/3/detail"
|
||||
onSubmit={jest.fn()}
|
||||
onCancel={jest.fn()}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(
|
||||
wrapper
|
||||
.find('CodeEditor')
|
||||
.at(0)
|
||||
.prop('value')
|
||||
).toEqual('Started');
|
||||
});
|
||||
|
||||
test('should submit', async () => {
|
||||
const handleSubmit = jest.fn();
|
||||
const wrapper = mountWithContexts(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user