mirror of
https://github.com/ansible/awx.git
synced 2026-04-13 22:19:27 -02:30
fix a few tests with issues due to pf v4 react upgrade
This commit is contained in:
@@ -23,6 +23,7 @@ function AlertModal({
|
|||||||
i18n,
|
i18n,
|
||||||
isOpen = null,
|
isOpen = null,
|
||||||
title,
|
title,
|
||||||
|
label,
|
||||||
variant,
|
variant,
|
||||||
children,
|
children,
|
||||||
i18nHash,
|
i18nHash,
|
||||||
@@ -73,7 +74,7 @@ function AlertModal({
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
header={customHeader}
|
header={customHeader}
|
||||||
aria-label={i18n._(t`Alert modal`)}
|
aria-label={label || i18n._(t`Alert modal`)}
|
||||||
aria-labelledby="alert-modal-header-label"
|
aria-labelledby="alert-modal-header-label"
|
||||||
isOpen={Boolean(isOpen)}
|
isOpen={Boolean(isOpen)}
|
||||||
variant="small"
|
variant="small"
|
||||||
|
|||||||
@@ -475,6 +475,7 @@ class JobOutput extends Component {
|
|||||||
variant="danger"
|
variant="danger"
|
||||||
onClose={() => this.setState({ deletionError: null })}
|
onClose={() => this.setState({ deletionError: null })}
|
||||||
title={i18n._(t`Job Delete Error`)}
|
title={i18n._(t`Job Delete Error`)}
|
||||||
|
label={i18n._(t`Job Delete Error`)}
|
||||||
>
|
>
|
||||||
<ErrorDetail error={deletionError} />
|
<ErrorDetail error={deletionError} />
|
||||||
</AlertModal>
|
</AlertModal>
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ describe('<JobOutput />', () => {
|
|||||||
expect(JobsAPI.destroy).toHaveBeenCalledTimes(1);
|
expect(JobsAPI.destroy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.skip('should show error dialog for failed deletion', async () => {
|
test('should show error dialog for failed deletion', async () => {
|
||||||
JobsAPI.destroy.mockRejectedValue(new Error({}));
|
JobsAPI.destroy.mockRejectedValue(new Error({}));
|
||||||
wrapper = mountWithContexts(<JobOutput job={mockJob} />);
|
wrapper = mountWithContexts(<JobOutput job={mockJob} />);
|
||||||
await waitForElement(wrapper, 'JobEvent', el => el.length > 0);
|
await waitForElement(wrapper, 'JobEvent', el => el.length > 0);
|
||||||
@@ -338,7 +338,7 @@ describe('<JobOutput />', () => {
|
|||||||
wrapper.find('Modal button[aria-label="Delete"]').simulate('click');
|
wrapper.find('Modal button[aria-label="Delete"]').simulate('click');
|
||||||
await waitForElement(wrapper, 'Modal ErrorDetail');
|
await waitForElement(wrapper, 'Modal ErrorDetail');
|
||||||
const errorModalCloseBtn = wrapper.find(
|
const errorModalCloseBtn = wrapper.find(
|
||||||
'ModalBox div[aria-label="Job Delete Error"] button[aria-label="Close"]'
|
'ModalBox[aria-label="Job Delete Error"] ModalBoxCloseButton'
|
||||||
);
|
);
|
||||||
errorModalCloseBtn.simulate('click');
|
errorModalCloseBtn.simulate('click');
|
||||||
await waitForElement(wrapper, 'Modal ErrorDetail', el => el.length === 0);
|
await waitForElement(wrapper, 'Modal ErrorDetail', el => el.length === 0);
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import {
|
|||||||
WorkflowDispatchContext,
|
WorkflowDispatchContext,
|
||||||
WorkflowStateContext,
|
WorkflowStateContext,
|
||||||
} from '../../../../../contexts/Workflow';
|
} from '../../../../../contexts/Workflow';
|
||||||
import { mountWithContexts } from '../../../../../../testUtils/enzymeHelpers';
|
import {
|
||||||
|
waitForElement,
|
||||||
|
mountWithContexts,
|
||||||
|
} from '../../../../../../testUtils/enzymeHelpers';
|
||||||
import {
|
import {
|
||||||
InventorySourcesAPI,
|
InventorySourcesAPI,
|
||||||
JobTemplatesAPI,
|
JobTemplatesAPI,
|
||||||
@@ -22,7 +25,7 @@ let wrapper;
|
|||||||
const dispatch = jest.fn();
|
const dispatch = jest.fn();
|
||||||
const onSave = jest.fn();
|
const onSave = jest.fn();
|
||||||
|
|
||||||
describe.skip('NodeModal', () => {
|
describe('NodeModal', () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
JobTemplatesAPI.read.mockResolvedValue({
|
JobTemplatesAPI.read.mockResolvedValue({
|
||||||
data: {
|
data: {
|
||||||
@@ -95,6 +98,7 @@ describe.skip('NodeModal', () => {
|
|||||||
</WorkflowDispatchContext.Provider>
|
</WorkflowDispatchContext.Provider>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
await waitForElement(wrapper, 'PFWizard');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
@@ -307,6 +311,7 @@ describe.skip('NodeModal', () => {
|
|||||||
</WorkflowDispatchContext.Provider>
|
</WorkflowDispatchContext.Provider>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
await waitForElement(wrapper, 'PFWizard');
|
||||||
expect(wrapper.find('AnsibleSelect').prop('value')).toBe('project_sync');
|
expect(wrapper.find('AnsibleSelect').prop('value')).toBe('project_sync');
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper.find('AnsibleSelect').prop('onChange')(null, 'approval');
|
wrapper.find('AnsibleSelect').prop('onChange')(null, 'approval');
|
||||||
@@ -388,6 +393,7 @@ describe.skip('NodeModal', () => {
|
|||||||
</WorkflowDispatchContext.Provider>
|
</WorkflowDispatchContext.Provider>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
await waitForElement(wrapper, 'PFWizard');
|
||||||
expect(wrapper.find('AnsibleSelect').prop('value')).toBe('approval');
|
expect(wrapper.find('AnsibleSelect').prop('value')).toBe('approval');
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper.find('AnsibleSelect').prop('onChange')(
|
wrapper.find('AnsibleSelect').prop('onChange')(
|
||||||
|
|||||||
Reference in New Issue
Block a user