]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20482 Fix flaky FE tests QualityProfileApp-it.tsx
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>
Fri, 15 Sep 2023 15:33:19 +0000 (17:33 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 19 Sep 2023 20:02:47 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfileApp-it.tsx

index 4e375c5aa115dd4cb5400afcef0d7d780bd0ba23..d1ddc9772cf9e3539c0ce3c5d7cb02cfb84c400c 100644 (file)
@@ -152,7 +152,7 @@ describe('Admin or user with permission', () => {
     it('should not be able to grant permission if the profile is built-in', async () => {
       renderQualityProfile('sonar');
       await ui.waitForDataLoaded();
-      expect(await screen.findByText('Sonar way')).toBeInTheDocument();
+      expect(screen.getByRole('heading', { name: /\bSonar way\b/ })).toBeInTheDocument();
       expect(ui.permissionSection.query()).not.toBeInTheDocument();
     });
   });
@@ -305,7 +305,9 @@ describe('Admin or user with permission', () => {
       renderQualityProfile();
       await ui.waitForDataLoaded();
 
-      expect(await screen.findByText('Good old PHP quality profile')).toBeInTheDocument();
+      expect(
+        await screen.findByRole('heading', { name: 'Good old PHP quality profile' }),
+      ).toBeInTheDocument();
 
       await user.click(ui.qualityProfileActions.get());
       await user.click(ui.extendButton.get());