diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-02-14 10:51:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-14 10:51:22 +0100 |
commit | 8053754d961994e78ed973d37005bb6b5e8ceeae (patch) | |
tree | 42dce69c3ca726158e88e95544846449c84f4469 /server/sonar-web/src/main/js/apps/projectsManagement | |
parent | 94a57989f8160badd5c1e7cbb66fdbceaa3bb38d (diff) | |
download | sonarqube-8053754d961994e78ed973d37005bb6b5e8ceeae.tar.gz sonarqube-8053754d961994e78ed973d37005bb6b5e8ceeae.zip |
rewrite maintenance app in react (#3055)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectsManagement')
3 files changed, 6 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx index ed9c56dbcb1..09c56289581 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import { mount, shallow } from 'enzyme'; import BulkApplyTemplateModal, { Props } from '../BulkApplyTemplateModal'; -import { click } from '../../../helpers/testUtils'; +import { click, waitAndUpdate } from '../../../helpers/testUtils'; jest.mock('react-dom'); @@ -67,8 +67,7 @@ it('bulk applies template to all results', async () => { }); expect(wrapper).toMatchSnapshot(); - await new Promise(setImmediate); - wrapper.update(); + await waitAndUpdate(wrapper); expect(wrapper).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx index 1cdac62d85e..d79aa247497 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/CreateProjectForm-test.tsx @@ -27,7 +27,7 @@ jest.mock('../../../api/components', () => ({ import * as React from 'react'; import { shallow } from 'enzyme'; import CreateProjectForm from '../CreateProjectForm'; -import { change, submit, click } from '../../../helpers/testUtils'; +import { change, submit, click, waitAndUpdate } from '../../../helpers/testUtils'; import { Visibility } from '../../../app/types'; const createProject = require('../../../api/components').createProject as jest.Mock<any>; @@ -65,8 +65,7 @@ it('creates project', async () => { }); expect(wrapper).toMatchSnapshot(); - await new Promise(setImmediate); - wrapper.update(); + await waitAndUpdate(wrapper); expect(wrapper).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectRowActions-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectRowActions-test.tsx index a615b0e0c77..f9a5eee8406 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectRowActions-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/ProjectRowActions-test.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import { shallow } from 'enzyme'; import ProjectRowActions, { Props } from '../ProjectRowActions'; import { Visibility } from '../../../app/types'; -import { click } from '../../../helpers/testUtils'; +import { click, waitAndUpdate } from '../../../helpers/testUtils'; jest.mock('../../../api/components', () => ({ getComponentShow: jest.fn(() => Promise.reject(undefined)) @@ -45,8 +45,7 @@ it('restores access', async () => { expect(wrapper).toMatchSnapshot(); wrapper.prop<Function>('onToggleClick')(); - await new Promise(setImmediate); - wrapper.update(); + await waitAndUpdate(wrapper); expect(wrapper).toMatchSnapshot(); click(wrapper.find('.js-restore-access')); |