diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2022-11-24 17:06:36 +0800 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-11-28 11:29:35 +0000 |
commit | 92b539baecf11d5f743b66d5281d740dea893f02 (patch) | |
tree | 8df8b39f05bd5956a9f51c4c15cd0678007e9bdc /server/sonar-web/src/main/js/apps/issues | |
parent | 0a7ed973f44223e8af8af32462dc106a95a324c0 (diff) | |
download | sonarqube-92b539baecf11d5f743b66d5281d740dea893f02.tar.gz sonarqube-92b539baecf11d5f743b66d5281d740dea893f02.zip |
SONAR-17623 Preserve code tab scrolling and state
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues')
-rw-r--r-- | server/sonar-web/src/main/js/apps/issues/__tests__/IssueApp-it.tsx | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/__tests__/IssueApp-it.tsx b/server/sonar-web/src/main/js/apps/issues/__tests__/IssueApp-it.tsx index e53b3ce3f0f..5b718e55290 100644 --- a/server/sonar-web/src/main/js/apps/issues/__tests__/IssueApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/issues/__tests__/IssueApp-it.tsx @@ -22,6 +22,7 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import selectEvent from 'react-select-event'; import IssuesServiceMock from '../../../api/mocks/IssuesServiceMock'; +import { TabKeys } from '../../../components/rules/RuleTabViewer'; import { renderOwaspTop102021Category } from '../../../helpers/security-standard'; import { mockCurrentUser } from '../../../helpers/testMocks'; import { renderApp, renderAppRoutes } from '../../../helpers/testReactTestingUtils'; @@ -534,15 +535,17 @@ it('should show code tabs when any secondary location is selected', async () => screen.getByRole('tab', { name: 'coding_rules.description_section.title.root_cause' }) ); expect( - screen.queryByRole('row', { - name: '2 source_viewer.tooltip.covered import java.util. ArrayList ;', + screen.queryByRole('tab', { + name: `issue.tabs.${TabKeys.Code}`, + selected: true, }) ).not.toBeInTheDocument(); await user.click(screen.getByRole('button', { name: '1 location 1' })); expect( - screen.getByRole('row', { - name: '2 source_viewer.tooltip.covered import java.util. ArrayList ;', + screen.getByRole('tab', { + name: `issue.tabs.${TabKeys.Code}`, + selected: true, }) ).toBeInTheDocument(); @@ -551,15 +554,17 @@ it('should show code tabs when any secondary location is selected', async () => screen.getByRole('tab', { name: 'coding_rules.description_section.title.root_cause' }) ); expect( - screen.queryByRole('row', { - name: '2 source_viewer.tooltip.covered import java.util. ArrayList ;', + screen.queryByRole('tab', { + name: `issue.tabs.${TabKeys.Code}`, + selected: true, }) ).not.toBeInTheDocument(); await user.click(screen.getByRole('button', { name: '1 location 1' })); expect( - screen.getByRole('row', { - name: '2 source_viewer.tooltip.covered import java.util. ArrayList ;', + screen.getByRole('tab', { + name: `issue.tabs.${TabKeys.Code}`, + selected: true, }) ).toBeInTheDocument(); }); |