From b318f24490c9526079fef6b9b8aa4c22e67fa2d8 Mon Sep 17 00:00:00 2001 From: Keith Grant Date: Tue, 15 Oct 2019 12:55:26 -0700 Subject: [PATCH] don't skip JobDetail test now that async act works --- .../src/screens/Job/JobDetail/JobDetail.test.jsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/awx/ui_next/src/screens/Job/JobDetail/JobDetail.test.jsx b/awx/ui_next/src/screens/Job/JobDetail/JobDetail.test.jsx index ea2e1a54fa..076f16a940 100644 --- a/awx/ui_next/src/screens/Job/JobDetail/JobDetail.test.jsx +++ b/awx/ui_next/src/screens/Job/JobDetail/JobDetail.test.jsx @@ -82,12 +82,8 @@ describe('', () => { modal.find('button[aria-label="Delete"]').simulate('click'); expect(JobsAPI.destroy).toHaveBeenCalledTimes(1); }); - /* - The test below is skipped until react can be upgraded to at least 16.9.0. An upgrade to - 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 () => { + + test('should display error modal when a job does not delete properly', async () => { ProjectUpdatesAPI.destroy.mockRejectedValue( new Error({ response: { @@ -102,13 +98,11 @@ describe('', () => { ); const wrapper = mountWithContexts(); - wrapper - .find('button') - .at(0) - .simulate('click'); + wrapper.find('button[aria-label="Delete"]').simulate('click'); const modal = wrapper.find('Modal'); + expect(modal.length).toBe(1); await act(async () => { - await modal.find('Button[variant="danger"]').prop('onClick')(); + modal.find('button[aria-label="Delete"]').simulate('click'); }); wrapper.update();