]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21017 Tests: 'exact' has been removed from options for 'byRole' queries
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>
Tue, 21 Nov 2023 10:29:56 +0000 (11:29 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 24 Nov 2023 20:02:45 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/code/__tests__/Code-it.ts
server/sonar-web/src/main/js/apps/issues/__tests__/IssuesApp-it.tsx
server/sonar-web/src/main/js/apps/issues/test-utils.tsx
server/sonar-web/src/main/js/apps/sessions/components/__tests__/Login-it.tsx

index 726cd47a676422a8cf8230aee6d3a15e645aa6f5..11b351f57d0a82e7e8398b383fc0fef247e0391d 100644 (file)
@@ -388,8 +388,8 @@ it('should correctly show new VS overall measures for Portfolios', async () => {
 function getPageObject(user: UserEvent) {
   const ui = {
     componentName: (name: string) => byText(name),
-    childComponent: (name: string | RegExp) => byRole('cell', { name, exact: false }),
-    searchResult: (name: string | RegExp) => byRole('link', { name, exact: false }),
+    childComponent: (name: string | RegExp) => byRole('cell', { name }),
+    searchResult: (name: string | RegExp) => byRole('link', { name }),
     componentIsEmptyTxt: (qualifier: ComponentQualifier) =>
       byText(`code_viewer.no_source_code_displayed_due_to_empty_analysis.${qualifier}`),
     searchInput: byRole('searchbox'),
index 6c4457bbeaec788ac8b93d45c66d9a21d631d81b..e7a7d8d8611d729b585a932be87c53b063eb2252 100644 (file)
@@ -203,9 +203,7 @@ describe('issues app', () => {
       expect(screen.getByRole('link', { name: 'simpleRuleId' })).toBeInTheDocument();
 
       // The "Where is the issue" tab should be selected by default. Check its content
-      expect(screen.getAllByRole('button', { name: 'Issue on file', exact: false })).toHaveLength(
-        2,
-      ); // there will be 2 buttons one in concise issue and other in code viewer
+      expect(screen.getAllByRole('button', { name: 'Issue on file' })).toHaveLength(2); // there will be 2 buttons one in concise issue and other in code viewer
       expect(
         screen.getByRole('row', {
           name: '2 * SonarQube',
index 4ac409fb53d426f0ae603586ff347aab7e27c554..a69dccf38db171117368bc43cffb9e8f113f63ad 100644 (file)
@@ -64,7 +64,7 @@ export const ui = {
   issueItem7: byRole('region', { name: 'Issue with tags' }),
   issueItem8: byRole('region', { name: 'Issue on page 2' }),
   issueItem9: byRole('region', { name: 'Issue inside folderA' }),
-  projectIssueItem6: byRole('button', { name: 'Second issue', exact: false }),
+  projectIssueItem6: byRole('button', { name: 'Second issue' }),
 
   conciseIssueTotal: byTestId('page-counter-total'),
   conciseIssueItem2: byTestId('issues-nav-bar').byRole('button', { name: 'Fix that' }),
index 7864492228b0f9d8a239531861380d161fbcbeb7..be83dcf896821402b0983a0f9c459c3a7f6a3183 100644 (file)
@@ -125,9 +125,7 @@ it('should not show any OAuth providers if none are configured', async () => {
   expect(heading).toBeInTheDocument();
 
   // No OAuth providers, login form display by default.
-  expect(
-    screen.queryByRole('link', { name: 'login.login_with_x', exact: false }),
-  ).not.toBeInTheDocument();
+  expect(screen.queryByRole('link', { name: 'login.login_with_x' })).not.toBeInTheDocument();
   expect(screen.getByLabelText('login')).toBeInTheDocument();
 });