diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-10-24 09:56:27 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-10-26 20:21:00 +0200 |
commit | 3026740ee3e483b542aca2fad5f5e79a931faa87 (patch) | |
tree | c9866b262771baa0bd3470b8d831392c6ced1f92 /server/sonar-web/src/main/js/apps/projectQualityProfiles | |
parent | 69bcb8faa2f40f0e0e6e6a8427d178c02df2eff6 (diff) | |
download | sonarqube-3026740ee3e483b542aca2fad5f5e79a931faa87.tar.gz sonarqube-3026740ee3e483b542aca2fad5f5e79a931faa87.zip |
update web dependencies
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectQualityProfiles')
-rw-r--r-- | server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/ProfileRow-test.tsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/ProfileRow-test.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/ProfileRow-test.tsx index 43752c5281d..144f3803092 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/ProfileRow-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/__tests__/ProfileRow-test.tsx @@ -20,7 +20,6 @@ import * as React from 'react'; import { shallow } from 'enzyme'; import ProfileRow from '../ProfileRow'; -import { doAsync } from '../../../helpers/testUtils'; it('renders', () => { expect( @@ -34,9 +33,9 @@ it('renders', () => { ).toMatchSnapshot(); }); -it('changes profile', () => { +it('changes profile', async () => { const onChangeProfile = jest.fn(() => Promise.resolve()); - const wrapper = shallow( + const wrapper = shallow<ProfileRow>( <ProfileRow onChangeProfile={onChangeProfile} possibleProfiles={[randomProfile('bar'), randomProfile('baz')]} @@ -47,9 +46,8 @@ it('changes profile', () => { wrapper.find('Select').prop<Function>('onChange')({ value: 'baz' }); expect(onChangeProfile).toBeCalledWith('foo', 'baz'); expect(wrapper.state().loading).toBeTruthy(); - return doAsync().then(() => { - expect(wrapper.state().loading).toBeFalsy(); - }); + await new Promise(setImmediate); + expect(wrapper.state().loading).toBeFalsy(); }); function randomProfile(key: string) { |