diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2022-09-27 14:40:55 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-09-29 20:03:14 +0000 |
commit | 516a97f0bae4ae30ccdf6db3d328cbd1939d3ffc (patch) | |
tree | 7d39b063631bded3b0637986a494adab54b6cc75 /server/sonar-web | |
parent | 570bf526d9488a1a88248f27c1a3beb7457796d3 (diff) | |
download | sonarqube-516a97f0bae4ae30ccdf6db3d328cbd1939d3ffc.tar.gz sonarqube-516a97f0bae4ae30ccdf6db3d328cbd1939d3ffc.zip |
[NO JIRA] Fix flaky test
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx index 08d22435ec7..edefa213b80 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx @@ -29,29 +29,39 @@ import ComponentNav, { ComponentNavProps } from '../ComponentNav'; it('renders correctly when there are warnings', () => { renderComponentNav({ warnings: [mockTaskWarning()] }); - expect(screen.getByText('component_navigation.last_analysis_had_warnings')).toBeInTheDocument(); + expect( + screen.getByText('component_navigation.last_analysis_had_warnings', { exact: false }) + ).toBeInTheDocument(); }); it('renders correctly when there is a background task in progress', () => { renderComponentNav({ isInProgress: true }); - expect(screen.getByText('component_navigation.status.in_progress')).toBeInTheDocument(); + expect( + screen.getByText('component_navigation.status.in_progress', { exact: false }) + ).toBeInTheDocument(); }); it('renders correctly when there is a background task pending', () => { renderComponentNav({ isPending: true }); - expect(screen.getByText('component_navigation.status.pending')).toBeInTheDocument(); + expect( + screen.getByText('component_navigation.status.pending', { exact: false }) + ).toBeInTheDocument(); }); it('renders correctly when there is a failing background task', () => { renderComponentNav({ currentTask: mockTask({ status: TaskStatuses.Failed }) }); - expect(screen.getByText('component_navigation.status.failed_X')).toBeInTheDocument(); + expect( + screen.getByText('component_navigation.status.failed_X', { exact: false }) + ).toBeInTheDocument(); }); it('renders correctly when the project binding is incorrect', () => { renderComponentNav({ projectBindingErrors: mockProjectAlmBindingConfigurationErrors() }); - expect(screen.getByText('component_navigation.pr_deco.error_detected_X')).toBeInTheDocument(); + expect( + screen.getByText('component_navigation.pr_deco.error_detected_X', { exact: false }) + ).toBeInTheDocument(); }); it('correctly returns focus to the Project Information link when the drawer is closed', () => { |