msyavuz commented on code in PR #35782:
URL: https://github.com/apache/superset/pull/35782#discussion_r2490200483


##########
superset-frontend/src/components/Datasource/components/DatasourceEditor/components/DatasetUsageTab/DatasetUsageTab.test.tsx:
##########
@@ -211,16 +228,26 @@ test('displays data in correct order (last modified 
desc)', async () => {
 
 test('enables sorting for Chart and Last modified columns', async () => {
   setupTest();
-
   await waitFor(() => {
-    const chartHeader = screen.getByText('Chart').closest('th');
-    const lastModifiedHeader = screen.getByText('Last modified').closest('th');
-    const ownersHeader = screen.getByText('Chart owners').closest('th');
-    const dashboardHeader = screen.getByText('Dashboard usage').closest('th');
+    const chartHeader = screen
+      .getAllByText('Chart')
+      .map(el => el.closest('th'))
+      .find(Boolean);

Review Comment:
   ```suggestion
       const chartHeader = screen
         .getAllByText('Chart')
         .find(el => el.closest('th'));
   ```
   Can we shorten like this?



-- 
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