From: David Cho-Lerat Date: Fri, 15 Sep 2023 15:33:19 +0000 (+0200) Subject: SONAR-20482 Fix flaky FE tests QualityProfileApp-it.tsx X-Git-Tag: 10.3.0.82913~379 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=146fcef65438f387feac19dd393e649a8bb85b1f;p=sonarqube.git SONAR-20482 Fix flaky FE tests QualityProfileApp-it.tsx --- diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfileApp-it.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfileApp-it.tsx index 4e375c5aa11..d1ddc9772cf 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfileApp-it.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/__tests__/QualityProfileApp-it.tsx @@ -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());