]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20708 Improve tests for bulk import
authorViktor Vorona <viktor.vorona@sonarsource.com>
Tue, 17 Oct 2023 10:16:18 +0000 (12:16 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 18 Oct 2023 20:03:05 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/create/project/__tests__/GitHub-it.tsx

index 5d74c34d0a29830c5fdeaea277b9475e8c1088e3..a82be565d04fd06523f893b5e75335a587ddecad 100644 (file)
@@ -52,6 +52,7 @@ const ui = {
   project3Checkbox: byRole('listitem', { name: 'Github repo 3' }).byRole('checkbox'),
   checkAll: byRole('checkbox', { name: 'onboarding.create_project.select_all_repositories' }),
   importButton: byRole('button', { name: 'onboarding.create_project.import' }),
+  backButton: byRole('button', { name: 'back' }),
   newCodeTitle: byRole('heading', {
     name: 'onboarding.create_x_project.new_code_definition.title1',
   }),
@@ -215,8 +216,20 @@ it('should import several projects', async () => {
   expect(ui.changePeriodLaterInfo.get()).toBeInTheDocument();
   expect(ui.createProjectsButton.get()).toBeDisabled();
 
+  await user.click(ui.backButton.get());
+  expect(ui.project1Checkbox.get()).toBeChecked();
+  expect(ui.project2Checkbox.get()).toBeChecked();
+  expect(ui.project3Checkbox.get()).not.toBeChecked();
+  expect(ui.importButton.get()).toBeInTheDocument();
+  await user.click(ui.importButton.get());
+
+  expect(await ui.newCodeMultipleProjectTitle.find()).toBeInTheDocument();
+
   await user.click(ui.globalSettingRadio.get());
   expect(ui.createProjectsButton.get()).toBeEnabled();
+  await user.click(ui.createProjectsButton.get());
+
+  expect(await screen.findByText('/projects?sort=-creation_date')).toBeInTheDocument();
 });
 
 it('should show search filter when the authentication is successful', async () => {