justinpark commented on code in PR #29118:
URL: https://github.com/apache/superset/pull/29118#discussion_r1633922592


##########
superset-frontend/src/pages/SavedQueryList/SavedQueryList.test.jsx:
##########
@@ -302,9 +302,13 @@ describe('RTL', () => {
     userEvent.click(bulkSelectButton);
 
     // Grab and click the "toggle all" checkbox to expose export button
-    const selectAllCheckbox = screen.getByRole('checkbox', {
-      name: /toggle all rows selected/i,
-    });
+    const selectAllCheckbox = screen
+      .getAllByRole('checkbox', {
+        name: '',
+      })
+      .filter(
+        checkbox => checkbox.getAttribute('name') === 'header-toggle-all',
+      )[0];

Review Comment:
   Was there an issue with the previous code? If there is no reason for the 
changes, selecting functionality based on class names is not recommended.



##########
superset-frontend/src/pages/SavedQueryList/SavedQueryList.test.jsx:
##########
@@ -302,9 +302,13 @@ describe('RTL', () => {
     userEvent.click(bulkSelectButton);
 
     // Grab and click the "toggle all" checkbox to expose export button
-    const selectAllCheckbox = screen.getByRole('checkbox', {
-      name: /toggle all rows selected/i,
-    });
+    const selectAllCheckbox = screen
+      .getAllByRole('checkbox', {
+        name: '',
+      })
+      .filter(
+        checkbox => checkbox.getAttribute('name') === 'header-toggle-all',
+      )[0];

Review Comment:
   Was there an issue with the previous code? If there is no reason for the 
changes, selecting functionality based on field names is not recommended.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to