mirror of
https://github.com/ansible/awx.git
synced 2026-04-08 19:49:22 -02:30
don't skip JobDetail test now that async act works
This commit is contained in:
@@ -82,12 +82,8 @@ describe('<JobDetail />', () => {
|
|||||||
modal.find('button[aria-label="Delete"]').simulate('click');
|
modal.find('button[aria-label="Delete"]').simulate('click');
|
||||||
expect(JobsAPI.destroy).toHaveBeenCalledTimes(1);
|
expect(JobsAPI.destroy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
The test below is skipped until react can be upgraded to at least 16.9.0. An upgrade to
|
test('should display error modal when a job does not delete properly', async () => {
|
||||||
react - router will likely be necessary also.
|
|
||||||
See: https://github.com/ansible/awx/issues/4817
|
|
||||||
*/
|
|
||||||
test.skip('should display error modal when a job does not delete properly', async () => {
|
|
||||||
ProjectUpdatesAPI.destroy.mockRejectedValue(
|
ProjectUpdatesAPI.destroy.mockRejectedValue(
|
||||||
new Error({
|
new Error({
|
||||||
response: {
|
response: {
|
||||||
@@ -102,13 +98,11 @@ describe('<JobDetail />', () => {
|
|||||||
);
|
);
|
||||||
const wrapper = mountWithContexts(<JobDetail job={mockJobData} />);
|
const wrapper = mountWithContexts(<JobDetail job={mockJobData} />);
|
||||||
|
|
||||||
wrapper
|
wrapper.find('button[aria-label="Delete"]').simulate('click');
|
||||||
.find('button')
|
|
||||||
.at(0)
|
|
||||||
.simulate('click');
|
|
||||||
const modal = wrapper.find('Modal');
|
const modal = wrapper.find('Modal');
|
||||||
|
expect(modal.length).toBe(1);
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
await modal.find('Button[variant="danger"]').prop('onClick')();
|
modal.find('button[aria-label="Delete"]').simulate('click');
|
||||||
});
|
});
|
||||||
wrapper.update();
|
wrapper.update();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user