diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.jsx
index d38aa28bbc..fa2575fd8b 100644
--- a/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.jsx
+++ b/awx/ui_next/src/components/AdHocCommands/AdHocCommandsWizard.test.jsx
@@ -17,6 +17,10 @@ const verbosityOptions = [
{ value: '3', key: '3', label: '3 (Debug)' },
{ value: '4', key: '4', label: '4 (Connection Debug)' },
];
+const moduleOptions = [
+ ['command', 'command'],
+ ['shell', 'shell'],
+];
const adHocItems = [
{ name: 'Inventory 1' },
{ name: 'Inventory 2' },
@@ -31,7 +35,7 @@ describe('', () => {
{}}
credentialTypeId={1}
diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.jsx
index 9a1f4fb094..fa6f931c24 100644
--- a/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.jsx
+++ b/awx/ui_next/src/components/AdHocCommands/AdHocCredentialStep.jsx
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import { useField } from 'formik';
import { Form, FormGroup } from '@patternfly/react-core';
import { CredentialsAPI } from '../../api';
-import { FieldTooltip } from '../FormField';
+import Popover from '../Popover';
import { getQSConfig, parseQueryString, mergeParams } from '../../util/qs';
import useRequest from '../../util/useRequest';
@@ -72,7 +72,7 @@ function AdHocCredentialStep({ i18n, credentialTypeId, onEnableLaunch }) {
}
helperTextInvalid={credentialMeta.error}
labelIcon={
-
{i18n._(t`Enable privilege escalation`)}
-
{i18n._(t`Enables creation of a provisioning
diff --git a/awx/ui_next/src/components/CodeMirrorInput/CodeMirrorField.jsx b/awx/ui_next/src/components/CodeMirrorInput/CodeMirrorField.jsx
index d08ab12674..35ebf32721 100644
--- a/awx/ui_next/src/components/CodeMirrorInput/CodeMirrorField.jsx
+++ b/awx/ui_next/src/components/CodeMirrorInput/CodeMirrorField.jsx
@@ -12,7 +12,7 @@ import {
import { useField } from 'formik';
import { FormGroup } from '@patternfly/react-core';
import CodeMirrorInput from './CodeMirrorInput';
-import { FieldTooltip } from '../FormField';
+import Popover from '../Popover';
function CodeMirrorField({
id,
@@ -37,7 +37,7 @@ function CodeMirrorField({
isRequired={isRequired}
validated={isValid ? 'default' : 'error'}
label={label}
- labelIcon={}
+ labelIcon={}
>
{helpText && (
-
+
)}
@@ -122,9 +122,13 @@ VariablesDetail.propTypes = {
value: oneOfType([shape({}), arrayOf(string), string]).isRequired,
label: node.isRequired,
rows: number,
+ dataCy: string,
+ helpText: string,
};
VariablesDetail.defaultProps = {
rows: null,
+ dataCy: '',
+ helpText: '',
};
export default VariablesDetail;
diff --git a/awx/ui_next/src/components/CodeMirrorInput/VariablesField.jsx b/awx/ui_next/src/components/CodeMirrorInput/VariablesField.jsx
index 9268771e0f..1db21fdf04 100644
--- a/awx/ui_next/src/components/CodeMirrorInput/VariablesField.jsx
+++ b/awx/ui_next/src/components/CodeMirrorInput/VariablesField.jsx
@@ -5,10 +5,11 @@ import { t } from '@lingui/macro';
import { useField } from 'formik';
import styled from 'styled-components';
import { Split, SplitItem } from '@patternfly/react-core';
-import { CheckboxField, FieldTooltip } from '../FormField';
+import { CheckboxField } from '../FormField';
import MultiButtonToggle from '../MultiButtonToggle';
import { yamlToJson, jsonToYaml, isJsonString } from '../../util/yaml';
import CodeMirrorInput from './CodeMirrorInput';
+import Popover from '../Popover';
import { JSON_MODE, YAML_MODE } from './constants';
const FieldHeader = styled.div`
@@ -43,7 +44,7 @@ function VariablesField({
- {tooltip && }
+ {tooltip && }
{
@@ -11,7 +11,7 @@ describe('VariablesField', () => {
it('should render code mirror input', () => {
const value = '---\n';
- const wrapper = mount(
+ const wrapper = mountWithContexts(
{() => (
@@ -24,7 +24,7 @@ describe('VariablesField', () => {
it('should render yaml/json toggles', async () => {
const value = '---\n';
- const wrapper = mount(
+ const wrapper = mountWithContexts(
{() => (
@@ -52,7 +52,7 @@ describe('VariablesField', () => {
it('should set Formik error if yaml is invalid', async () => {
const value = '---\nfoo bar\n';
- const wrapper = mount(
+ const wrapper = mountWithContexts(
{() => (
@@ -71,7 +71,7 @@ describe('VariablesField', () => {
});
it('should render tooltip', () => {
const value = '---\n';
- const wrapper = mount(
+ const wrapper = mountWithContexts(
{() => (
{
)}
);
- expect(wrapper.find('Popover').length).toBe(1);
+ expect(wrapper.find('Popover[data-cy="the-field"]').length).toBe(1);
});
it('should submit value through Formik', async () => {
const value = '---\nfoo: bar\n';
const handleSubmit = jest.fn();
- const wrapper = mount(
+ const wrapper = mountWithContexts(
{formik => (