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