expect(screen.queryByText('project.info.ai_code_assurance.title')).not.toBeInTheDocument();
});
+it('should display ai code fix section if enabled', async () => {
+ renderProjectInformationApp({
+ isAiCodeFixEnabled: true,
+ });
+ expect(await ui.projectPageTitle.find()).toBeInTheDocument();
+ expect(screen.getByText('project.info.ai_code_fix.title')).toBeInTheDocument();
+ expect(screen.getByText('project.info.ai_code_fix.message')).toBeInTheDocument();
+});
+
+it('should not display ai code fix section if disabled', async () => {
+ renderProjectInformationApp({
+ isAiCodeFixEnabled: false,
+ });
+ expect(await ui.projectPageTitle.find()).toBeInTheDocument();
+ expect(screen.queryByText('project.info.ai_code_fix.title')).not.toBeInTheDocument();
+ expect(screen.queryByText('project.info.ai_code_fix.message')).not.toBeInTheDocument();
+});
+
it('should not show field that is not configured', async () => {
renderProjectInformationApp({
qualityGate: undefined,
</ProjectInformationSection>
)}
+ {component.isAiCodeFixEnabled === true && (
+ <ProjectInformationSection>
+ <SubHeading>{translate('project.info.ai_code_fix.title')}</SubHeading>
+ <span>
+ <FormattedMessage id="project.info.ai_code_fix.message" />
+ </span>
+ </ProjectInformationSection>
+ )}
+
<ProjectInformationSection>
<MetaKey componentKey={component.key} qualifier={component.qualifier} />
</ProjectInformationSection>
overview.project_key.tooltip.APP=Your application key is a unique identifier for your application.
project.info.ai_code_assurance.title=AI Code Assurance
project.info.quality_gate.ai_code_assurance.description=This project contains AI-generated code. It must use Sonar way Quality Gate to benefit from Sonar’s AI Code Assurance.
+project.info.ai_code_fix.title=AI CodeFix
+project.info.ai_code_fix.message=AI CodeFix is enabled for this project.
#------------------------------------------------------------------------------