]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12245 Fix broken test for extend profile form test
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Mon, 29 Jul 2019 08:38:28 +0000 (10:38 +0200)
committerSonarTech <sonartech@sonarsource.com>
Mon, 29 Jul 2019 18:21:10 +0000 (20:21 +0200)
server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ExtendProfileForm-test.tsx

index 27cebfc1b69cd5bb7e0fd39973bbd999225c1974..868e03c1b7b12b8a9766a66ad0f6d455c232bfe9 100644 (file)
@@ -19,7 +19,7 @@
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
-import { click } from 'sonar-ui-common/helpers/testUtils';
+import { click, waitAndUpdate } from 'sonar-ui-common/helpers/testUtils';
 import { changeProfileParent, createQualityProfile } from '../../../../api/quality-profiles';
 import { mockQualityProfile } from '../../../../helpers/testMocks';
 import ExtendProfileForm from '../ExtendProfileForm';
@@ -46,7 +46,7 @@ it('should correctly create a new profile and extend the existing one', async ()
 
   wrapper.setState({ name }).update();
   click(wrapper.find('SubmitButton'));
-  await Promise.resolve(setImmediate);
+  await waitAndUpdate(wrapper);
 
   const data = new FormData();
   data.append('language', profile.language);