Add container group flag to add/edit data

This commit is contained in:
Jake McDermott
2021-03-15 12:50:33 -04:00
committed by Shane McDonald
parent 1c4a376758
commit 098ec63944
4 changed files with 5 additions and 0 deletions

View File

@@ -33,6 +33,7 @@ function ContainerGroupAdd() {
pod_spec_override: values.override pod_spec_override: values.override
? getPodSpecValue(values.pod_spec_override) ? getPodSpecValue(values.pod_spec_override)
: null, : null,
is_container_group: true,
}); });
history.push(`/instance_groups/container_group/${response.id}/details`); history.push(`/instance_groups/container_group/${response.id}/details`);
} catch (error) { } catch (error) {

View File

@@ -26,6 +26,7 @@ const initialPodSpec = {
}, },
], ],
}, },
is_container_group: true,
}, },
}; };
@@ -80,6 +81,7 @@ describe('<ContainerGroupAdd/>', () => {
expect(InstanceGroupsAPI.create).toHaveBeenCalledWith({ expect(InstanceGroupsAPI.create).toHaveBeenCalledWith({
...instanceGroupCreateData, ...instanceGroupCreateData,
credential: 71, credential: 71,
is_container_group: true,
}); });
expect(wrapper.find('FormSubmitError').length).toBe(0); expect(wrapper.find('FormSubmitError').length).toBe(0);
expect(history.location.pathname).toBe( expect(history.location.pathname).toBe(

View File

@@ -39,6 +39,7 @@ function ContainerGroupEdit({ instanceGroup }) {
name: values.name, name: values.name,
credential: values.credential ? values.credential.id : null, credential: values.credential ? values.credential.id : null,
pod_spec_override: values.override ? values.pod_spec_override : null, pod_spec_override: values.override ? values.pod_spec_override : null,
is_container_group: true,
}); });
history.push(detailsIUrl); history.push(detailsIUrl);
} catch (error) { } catch (error) {

View File

@@ -147,6 +147,7 @@ describe('<ContainerGroupEdit/>', () => {
...updatedInstanceGroup, ...updatedInstanceGroup,
credential: 12, credential: 12,
pod_spec_override: null, pod_spec_override: null,
is_container_group: true,
}); });
expect(history.location.pathname).toEqual( expect(history.location.pathname).toEqual(
'/instance_groups/container_group/123/details' '/instance_groups/container_group/123/details'