From 146fcef65438f387feac19dd393e649a8bb85b1f Mon Sep 17 00:00:00 2001 From: David Cho-Lerat Date: Fri, 15 Sep 2023 17:33:19 +0200 Subject: [PATCH] SONAR-20482 Fix flaky FE tests QualityProfileApp-it.tsx --- .../quality-profiles/__tests__/QualityProfileApp-it.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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()); -- 2.39.5