Adds elements and identifiers for cypress tests

Properly display instance groups and labels on node details view
This commit is contained in:
mabashian
2022-09-13 14:42:58 -04:00
committed by Alan Rominger
parent d63c940e2f
commit ead56bfa1b
8 changed files with 195 additions and 182 deletions

View File

@@ -132,7 +132,7 @@ function CredentialsStep({
);
return (
<>
<div data-cy="credentials-prompt">
{meta.error && (
<CredentialErrorAlert variant="danger" isInline title={meta.error} />
)}
@@ -208,7 +208,7 @@ function CredentialsStep({
}}
renderItemChip={renderChip}
/>
</>
</div>
);
}

View File

@@ -66,6 +66,7 @@ function ExecutionEnvironmentStep() {
}
return (
<div data-cy="execution-environment-prompt">
<OptionsList
value={field.value ? [field.value] : []}
options={execution_environments}
@@ -110,6 +111,7 @@ function ExecutionEnvironmentStep() {
selectItem={helpers.setValue}
deselectItem={() => helpers.setValue(null)}
/>
</div>
);
}

View File

@@ -68,6 +68,7 @@ function InstanceGroupsStep() {
}
return (
<div data-cy="instance-groups-prompt">
<OptionsList
value={selected}
options={instance_groups}
@@ -100,6 +101,7 @@ function InstanceGroupsStep() {
sortSelectedItems={(selectedItems) => setSelected(selectedItems)}
isSelectedDraggable
/>
</div>
);
}

View File

@@ -70,7 +70,7 @@ function InventoryStep({ warningMessage = null }) {
}
return (
<>
<div data-cy="inventory-prompt">
{meta.touched && meta.error && (
<InventoryErrorAlert variant="danger" isInline title={meta.error} />
)}
@@ -109,7 +109,7 @@ function InventoryStep({ warningMessage = null }) {
selectItem={helpers.setValue}
deselectItem={() => field.onChange(null)}
/>
</>
</div>
);
}

View File

@@ -28,6 +28,7 @@ function OtherPromptsStep({ launchConfig, variablesMode, onVarModeChange }) {
? jobHelpText
: workflowHelpText;
return (
<div data-cy="other-prompts">
<Form
onSubmit={(e) => {
e.preventDefault();
@@ -117,6 +118,7 @@ function OtherPromptsStep({ launchConfig, variablesMode, onVarModeChange }) {
/>
)}
</Form>
</div>
);
}

View File

@@ -52,7 +52,7 @@ function PreviewStep({ resource, launchConfig, surveyConfig, formErrors }) {
}
return (
<>
<div data-cy="prompt-preview">
{formErrors && (
<ErrorMessageWrapper>
{t`Some of the previous step(s) have errors`}
@@ -70,7 +70,7 @@ function PreviewStep({ resource, launchConfig, surveyConfig, formErrors }) {
launchConfig={launchConfig}
overrides={overrides}
/>
</>
</div>
);
}

View File

@@ -31,6 +31,7 @@ function SurveyStep({ surveyConfig }) {
float: NumberField,
};
return (
<div data-cy="survey-prompts">
<Form
onSubmit={(e) => {
e.preventDefault();
@@ -41,6 +42,7 @@ function SurveyStep({ surveyConfig }) {
return <Field key={question.variable} question={question} />;
})}
</Form>
</div>
);
}
SurveyStep.propTypes = {

View File

@@ -19,6 +19,8 @@ function NodeViewModal({ readOnly }) {
const {
fullUnifiedJobTemplate,
originalNodeCredentials,
originalNodeInstanceGroups,
originalNodeLabels,
originalNodeObject,
promptValues,
} = nodeToView;
@@ -160,7 +162,7 @@ function NodeViewModal({ readOnly }) {
originalNodeObject.summary_fields.execution_environment;
}
if (launchConfig.ask_labels_on_launch) {
overrides.labels = originalNodeObject.labels;
overrides.labels = originalNodeLabels || [];
}
if (launchConfig.ask_forks_on_launch) {
overrides.forks = originalNodeObject.forks;
@@ -204,6 +206,9 @@ function NodeViewModal({ readOnly }) {
if (launchConfig.ask_credential_on_launch) {
overrides.credentials = originalNodeCredentials || [];
}
if (launchConfig.ask_instance_groups_on_launch) {
overrides.instance_groups = originalNodeInstanceGroups || [];
}
}
let nodeUpdatedConvergence = {};