diff options
author | stanislavh <stanislav.honcharov@sonarsource.com> | 2024-02-23 13:28:28 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-02-23 20:02:36 +0000 |
commit | ecae0ab5ff9df5c0aac1f252dd9a976f0b673475 (patch) | |
tree | be34845f818fa541ede373ecb8af06c2b8d23a91 /server/sonar-web/src/main/js | |
parent | bf71383a30f8c44e3b2e703c08f76431b1eace1e (diff) | |
download | sonarqube-ecae0ab5ff9df5c0aac1f252dd9a976f0b673475.tar.gz sonarqube-ecae0ab5ff9df5c0aac1f252dd9a976f0b673475.zip |
SONAR-21692 Improve Account-it, ProjectDumpApp-it tests
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/account/__tests__/Account-it.tsx | 16 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-it.tsx | 8 |
2 files changed, 9 insertions, 15 deletions
diff --git a/server/sonar-web/src/main/js/apps/account/__tests__/Account-it.tsx b/server/sonar-web/src/main/js/apps/account/__tests__/Account-it.tsx index 4fefa37feb8..e4835da67f5 100644 --- a/server/sonar-web/src/main/js/apps/account/__tests__/Account-it.tsx +++ b/server/sonar-web/src/main/js/apps/account/__tests__/Account-it.tsx @@ -401,9 +401,9 @@ describe('security page', () => { securityPagePath, ); - await waitFor(() => { - selectEvent.openMenu(screen.getByRole('combobox', { name: 'users.tokens.type' })); - }); + expect(await screen.findByText('users.tokens.generate')).toBeInTheDocument(); + + await selectEvent.openMenu(screen.getByRole('combobox', { name: 'users.tokens.type' })); expect(screen.queryByText(`users.tokens.${TokenType.Project}`)).not.toBeInTheDocument(); }); @@ -430,12 +430,10 @@ describe('security page', () => { mockLoggedInUser({ permissions: { global: [Permissions.Scan] } }), securityPagePath, ); - - await waitFor(async () => { - await selectEvent.select(screen.getByRole('combobox', { name: 'users.tokens.type' }), [ - `users.tokens.${TokenType.Project}`, - ]); - }); + expect(await screen.findByText('users.tokens.generate')).toBeInTheDocument(); + await selectEvent.select(screen.getByRole('combobox', { name: 'users.tokens.type' }), [ + `users.tokens.${TokenType.Project}`, + ]); expect(screen.getByText('Project Name 1')).toBeInTheDocument(); }); diff --git a/server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-it.tsx b/server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-it.tsx index ed0305a8f2e..c5cd470108b 100644 --- a/server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-it.tsx @@ -114,9 +114,7 @@ it('should show pending->in progress->failed export', async () => { status: TaskStatuses.InProgress, startedAt: '2023-06-08T12:00:00Z', }); - act(() => { - jest.runOnlyPendingTimers(); - }); + jest.runOnlyPendingTimers(); expect(await ui.inProgressExport.find()).toBeInTheDocument(); expect(ui.exportBtn.query()).not.toBeInTheDocument(); @@ -164,9 +162,7 @@ it('should show pending->in progress->failed import', async () => { status: TaskStatuses.InProgress, startedAt: '2023-06-08T12:00:00Z', }); - act(() => { - jest.runOnlyPendingTimers(); - }); + jest.runOnlyPendingTimers(); expect(await ui.inProgressImport.find()).toBeInTheDocument(); expect(ui.importBtn.query()).not.toBeInTheDocument(); |