mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
Fix worfklow node info
Fix workflow node info. See: https://github.com/ansible/awx/issues/11061 Also: https://github.com/ansible/awx/issues/10628
This commit is contained in:
parent
0ac3a377fd
commit
313de35e60
@ -190,16 +190,19 @@ function NodeViewModal({ readOnly }) {
|
||||
let nodeUpdatedConvergence = {};
|
||||
|
||||
if (
|
||||
nodeToView.all_parents_must_converge !== undefined &&
|
||||
nodeToView.all_parents_must_converge !==
|
||||
nodeToView.originalNodeObject.all_parents_must_converge
|
||||
nodeToView?.all_parents_must_converge !== undefined &&
|
||||
nodeToView?.all_parents_must_converge !==
|
||||
nodeToView?.originalNodeObject?.all_parents_must_converge
|
||||
) {
|
||||
nodeUpdatedConvergence = {
|
||||
...nodeToView.originalNodeObject,
|
||||
all_parents_must_converge: nodeToView.all_parents_must_converge,
|
||||
};
|
||||
} else {
|
||||
nodeUpdatedConvergence = nodeToView.originalNodeObject;
|
||||
nodeUpdatedConvergence = {
|
||||
...nodeToView.originalNodeObject,
|
||||
all_parents_must_converge: nodeToView?.all_parents_must_converge,
|
||||
};
|
||||
}
|
||||
|
||||
Content = (
|
||||
|
||||
@ -300,4 +300,35 @@ describe('NodeViewModal', () => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Convergence label', () => {
|
||||
const workflowContext = {
|
||||
nodeToView: {
|
||||
fullUnifiedJobTemplate: {
|
||||
id: 1,
|
||||
name: 'Mock Node',
|
||||
description: '',
|
||||
type: 'workflow_approval_template',
|
||||
timeout: 0,
|
||||
all_parents_must_converge: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
test('should display "Any" Convergence label', async () => {
|
||||
let wrapper;
|
||||
await act(async () => {
|
||||
wrapper = mountWithContexts(
|
||||
<WorkflowDispatchContext.Provider value={dispatch}>
|
||||
<WorkflowStateContext.Provider value={workflowContext}>
|
||||
<NodeViewModal />
|
||||
</WorkflowStateContext.Provider>
|
||||
</WorkflowDispatchContext.Provider>
|
||||
);
|
||||
});
|
||||
waitForLoaded(wrapper);
|
||||
expect(wrapper.find('Detail[label="Convergence"] dd').text()).toBe('Any');
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user