Fixes unit tests after updating the Inventory Lookup

This commit is contained in:
mabashian
2022-09-13 11:14:25 -04:00
parent cc6eaa7f44
commit 7143777638
3 changed files with 6 additions and 9 deletions

View File

@@ -26,7 +26,6 @@ function InventoryLookup({
hideSmartInventories, hideSmartInventories,
history, history,
isDisabled, isDisabled,
isOverrideDisabled,
isPromptableField, isPromptableField,
onBlur, onBlur,
onChange, onChange,
@@ -120,7 +119,7 @@ function InventoryLookup({
label={t`Inventory`} label={t`Inventory`}
promptId={promptId} promptId={promptId}
promptName={promptName} promptName={promptName}
isDisabled={isOverrideDisabled || isDisabled} isDisabled={isDisabled}
tooltip={t`Select the inventory containing the hosts tooltip={t`Select the inventory containing the hosts
you want this job to manage.`} you want this job to manage.`}
> >
@@ -136,7 +135,7 @@ function InventoryLookup({
fieldName={fieldName} fieldName={fieldName}
validate={validate} validate={validate}
isLoading={isLoading} isLoading={isLoading}
isDisabled={isOverrideDisabled || isDisabled} isDisabled={isDisabled}
qsConfig={QS_CONFIG} qsConfig={QS_CONFIG}
renderOptionsList={({ state, dispatch, canDelete }) => ( renderOptionsList={({ state, dispatch, canDelete }) => (
<OptionsList <OptionsList
@@ -191,7 +190,7 @@ function InventoryLookup({
onBlur={onBlur} onBlur={onBlur}
required={required} required={required}
isLoading={isLoading} isLoading={isLoading}
isDisabled={isOverrideDisabled || isDisabled} isDisabled={isDisabled}
qsConfig={QS_CONFIG} qsConfig={QS_CONFIG}
renderOptionsList={({ state, dispatch, canDelete }) => ( renderOptionsList={({ state, dispatch, canDelete }) => (
<OptionsList <OptionsList
@@ -242,7 +241,6 @@ InventoryLookup.propTypes = {
fieldName: string, fieldName: string,
hideSmartInventories: bool, hideSmartInventories: bool,
isDisabled: bool, isDisabled: bool,
isOverrideDisabled: bool,
onChange: func.isRequired, onChange: func.isRequired,
required: bool, required: bool,
validate: func, validate: func,
@@ -255,7 +253,6 @@ InventoryLookup.defaultProps = {
fieldName: 'inventory', fieldName: 'inventory',
hideSmartInventories: false, hideSmartInventories: false,
isDisabled: false, isDisabled: false,
isOverrideDisabled: false,
required: false, required: false,
validate: () => {}, validate: () => {},
value: null, value: null,

View File

@@ -99,7 +99,7 @@ describe('InventoryLookup', () => {
await act(async () => { await act(async () => {
wrapper = mountWithContexts( wrapper = mountWithContexts(
<Formik> <Formik>
<InventoryLookup isOverrideDisabled onChange={() => {}} /> <InventoryLookup onChange={() => {}} />
</Formik> </Formik>
); );
}); });
@@ -121,7 +121,7 @@ describe('InventoryLookup', () => {
await act(async () => { await act(async () => {
wrapper = mountWithContexts( wrapper = mountWithContexts(
<Formik> <Formik>
<InventoryLookup onChange={() => {}} /> <InventoryLookup isDisabled onChange={() => {}} />
</Formik> </Formik>
); );
}); });

View File

@@ -151,7 +151,7 @@ function WorkflowJobTemplateForm({
onChange={handleInventoryUpdate} onChange={handleInventoryUpdate}
touched={inventoryMeta.touched} touched={inventoryMeta.touched}
error={inventoryMeta.error} error={inventoryMeta.error}
isOverrideDisabled={isInventoryDisabled} isDisabled={isInventoryDisabled}
/> />
</FormGroup> </FormGroup>
<FieldWithPrompt <FieldWithPrompt