diff options
Diffstat (limited to 'server/sonar-web/src/main/js')
3 files changed, 19 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx b/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx index a4ad9efe448..c29f06ff088 100644 --- a/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectDump/ProjectDumpApp.tsx @@ -170,7 +170,7 @@ export class ProjectDumpApp extends React.Component<Props, State> { <header className="sw-mb-5"> <Helmet defer={false} title={translate('project_dump.page')} /> <Title className="sw-mb-4">{translate('project_dump.page')}</Title> - <p> + <div> {projectImportFeatureEnabled ? ( <> <p>{translate('project_dump.page.description1')}</p> @@ -182,7 +182,7 @@ export class ProjectDumpApp extends React.Component<Props, State> { <p>{translate('project_dump.page.description_without_import2')}</p> </> )} - </p> + </div> </header> <Spinner loading={status === undefined}> 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 d1e37fad5d4..ed0305a8f2e 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 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { screen } from '@testing-library/react'; +import { act, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import ComputeEngineServiceMock from '../../../api/mocks/ComputeEngineServiceMock'; import { ProjectDumpServiceMock } from '../../../api/mocks/ProjectDumpServiceMock'; @@ -103,6 +103,7 @@ it('should show pending->in progress->failed export', async () => { status: TaskStatuses.Pending, submittedAt: '2023-06-08T11:55:00Z', }); + await userEvent.click(await ui.exportBtn.find()); expect(await ui.pendingExport.find()).toBeInTheDocument(); expect(ui.exportBtn.query()).not.toBeInTheDocument(); @@ -113,7 +114,9 @@ it('should show pending->in progress->failed export', async () => { status: TaskStatuses.InProgress, startedAt: '2023-06-08T12:00:00Z', }); - jest.runOnlyPendingTimers(); + act(() => { + jest.runOnlyPendingTimers(); + }); expect(await ui.inProgressExport.find()).toBeInTheDocument(); expect(ui.exportBtn.query()).not.toBeInTheDocument(); @@ -123,7 +126,9 @@ it('should show pending->in progress->failed export', async () => { status: TaskStatuses.Failed, executedAt: '2023-06-08T12:05:00Z', }); - jest.runOnlyPendingTimers(); + act(() => { + jest.runOnlyPendingTimers(); + }); expect(await ui.failedExport.find()).toBeInTheDocument(); expect(ui.exportBtn.get()).toBeInTheDocument(); }); @@ -159,7 +164,9 @@ it('should show pending->in progress->failed import', async () => { status: TaskStatuses.InProgress, startedAt: '2023-06-08T12:00:00Z', }); - jest.runOnlyPendingTimers(); + act(() => { + jest.runOnlyPendingTimers(); + }); expect(await ui.inProgressImport.find()).toBeInTheDocument(); expect(ui.importBtn.query()).not.toBeInTheDocument(); @@ -169,7 +176,9 @@ it('should show pending->in progress->failed import', async () => { status: TaskStatuses.Failed, executedAt: '2023-06-08T12:05:00Z', }); - jest.runOnlyPendingTimers(); + act(() => { + jest.runOnlyPendingTimers(); + }); expect(await ui.failedImport.find()).toBeInTheDocument(); expect(ui.importBtn.get()).toBeInTheDocument(); }); diff --git a/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx b/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx index 6a1957ed89a..7fa2d76ab28 100644 --- a/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx +++ b/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx @@ -41,7 +41,7 @@ const EDUCATION_PRINCIPLES_MAP: Dict<React.ComponentType<React.PropsWithChildren never_trust_user_input: NeverTrustUserInput, }; -export default class MoreInfoRuleDescription extends React.PureComponent<Props, {}> { +export default class MoreInfoRuleDescription extends React.PureComponent<Props> { handleNotificationScroll = () => { const element = this.props.educationPrinciplesRef?.current; @@ -114,7 +114,7 @@ const StyledEducationPrinciples = styled.div` background-color: ${themeColor('educationPrincipleBackground')}; border: ${themeBorder('default', 'educationPrincipleBorder')}; - & h3:first-child { - margin-top: 0px; + & h3:first-of-type { + margin-top: 0; } `; |